languages
This commit is contained in:
parent
d30ca13783
commit
52d5e03f9b
1 changed files with 34 additions and 0 deletions
|
@ -1,5 +1,39 @@
|
|||
\documentclass[10pt]{article}
|
||||
|
||||
% manage languages ─────────────────────────────────────────────────────────────
|
||||
|
||||
% use package
|
||||
\usepackage{polyglossia}
|
||||
% use recommended package
|
||||
\usepackage{csquotes}
|
||||
|
||||
% set main
|
||||
\setmainlanguage{\mainlanguage}
|
||||
% set others
|
||||
\setotherlanguages{\otherlanguages}
|
||||
|
||||
% expand function ifstrequal
|
||||
\newcommand{\ifstreq}[4]{\expandafter\ifstrequal\expandafter{#1}{#2}{#3}{#4}}
|
||||
% return text, according to variable mainlanguage
|
||||
% 1: english text
|
||||
% 2: french text
|
||||
\newcommand{\ml}[2]{%
|
||||
\ifstreq{\mainlanguage}{english}{\ifstrempty{#1}{\todo}{#1}}{%
|
||||
\ifstreq{\mainlanguage}{french}{\ifstrempty{#2}{\todo}{#2}}{%
|
||||
ERROR%
|
||||
}}%
|
||||
}
|
||||
|
||||
% return text as english
|
||||
% 1: text
|
||||
\newcommand{\en}[1]{\textenglish{#1}}
|
||||
|
||||
% return text as french
|
||||
% 1: text
|
||||
\newcommand{\fr}[1]{\textfrench{#1}}
|
||||
|
||||
%
|
||||
|
||||
\usepackage{fontspec}
|
||||
\usepackage[a4paper,portrait,
|
||||
bmargin=10mm,lmargin=15mm,rmargin=15mm,tmargin=10mm]{geometry}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue