From 52d5e03f9b241e3edb7f69be5be65972450f030a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 26 May 2025 21:56:13 +0200 Subject: [PATCH] languages --- cnam.marc/thesis/topic/main.tex | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/cnam.marc/thesis/topic/main.tex b/cnam.marc/thesis/topic/main.tex index fb52a97..f008564 100644 --- a/cnam.marc/thesis/topic/main.tex +++ b/cnam.marc/thesis/topic/main.tex @@ -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}