cnam.marc/cnam/thesis/settings.tex

111 lines
3.2 KiB
TeX
Raw Normal View History

2020-10-29 09:30:10 +01:00
% define variables ─────────────────────────────────────────────────────────────
2020-10-18 01:20:02 +02:00
2020-10-29 09:30:10 +01:00
\def\todo{TODO}
% author
2020-10-18 01:15:58 +02:00
\def\authorname{BENINCA}
\def\authorshort{M. \authorname}
\def\authorlong{Marc \authorname}
2020-10-18 01:20:02 +02:00
2020-10-29 09:30:10 +01:00
% date
2020-10-18 01:20:02 +02:00
\def\dateshort{2021}
\def\datelong{\ml{Month DD, \dateshort}{JJ Mois \dateshort}}
2020-10-29 09:30:10 +01:00
% institute
2020-10-18 01:33:33 +02:00
\def\instituteshort{CNAM}
\def\institutelong{Conservatoire National des Arts et Métiers}
2020-10-29 09:30:10 +01:00
% manage languages ─────────────────────────────────────────────────────────────
% use package
2020-10-18 00:24:08 +02:00
\usepackage{polyglossia}
2020-10-29 09:30:10 +01:00
% use recommended package
2020-10-18 00:24:08 +02:00
\usepackage{csquotes}
2020-10-29 09:30:10 +01:00
% set main
2020-10-18 00:24:08 +02:00
\setmainlanguage{\mainlanguage}
2020-10-29 09:30:10 +01:00
% set others
2020-10-18 00:24:08 +02:00
\setotherlanguages{\otherlanguages}
2020-10-29 09:30:10 +01:00
% expand function ifstrequal
2020-10-18 00:24:08 +02:00
\newcommand{\ifstreq}[4]{\expandafter\ifstrequal\expandafter{#1}{#2}{#3}{#4}}
2020-10-29 08:52:33 +01:00
% return text, according to variable mainlanguage
% 1: english text
% 2: french text
2020-10-18 00:24:08 +02:00
\newcommand{\ml}[2]{%
\ifstreq{\mainlanguage}{english}{\ifstrempty{#1}{\todo}{#1}}{%
\ifstreq{\mainlanguage}{french}{\ifstrempty{#2}{\todo}{#2}}{%
ERROR%
}}%
}
2020-10-29 09:30:10 +01:00
% return text as english
% 1: text
2020-10-18 00:24:08 +02:00
\newcommand{\en}[1]{\textenglish{#1}}
2020-10-29 09:30:10 +01:00
% return text as french
% 1: text
2020-10-18 00:24:08 +02:00
\newcommand{\fr}[1]{\textfrench{#1}}
2020-10-18 01:53:11 +02:00
2020-10-29 09:30:10 +01:00
% define multilingual variables ────────────────────────────────────────────────
2020-10-18 01:53:11 +02:00
2020-10-29 09:30:10 +01:00
% title
2020-10-18 01:53:11 +02:00
\def\titleshort{\ml{Incremental Live OS}{SE autonomes incrémentaux}}
\ml
{\def\titlelong{Incremental Live Operating Systems}
\def\titlesub{a reversal of conventional approaches}}
{\def\titlelong{Systèmes d’Exploitation autonomes incrémentaux}
\def\titlesub{une inversion des approches conventionnelles}}
2020-10-29 09:30:10 +01:00
% type
2020-10-19 12:25:26 +02:00
\ml
{\def\typeshort{Thesis}}
{\def\typeshort{Mémoire}}
\ml
{\def\typelong{\instituteshort\ Master's \typeshort}}
{\def\typelong{\typeshort\ d’Ingénieur \instituteshort}}
2020-10-29 09:30:10 +01:00
% key words (part a)
2020-10-19 16:27:51 +02:00
\def\kwaen{one, two, three, four}
\def\kwafr{un, deux, trois, quatre}
2020-10-29 09:30:10 +01:00
% key words (part b)
2020-10-19 16:27:51 +02:00
\def\kwben{five, six, seven, eight}
\def\kwbfr{cinq, six, sept, huit}
2020-10-29 09:30:10 +01:00
% return key words (part a)
% 1: language
2020-10-19 16:11:13 +02:00
\newcommand{\kwa}[1]{%
2021-01-11 14:20:47 +01:00
\ifstreq{#1}{english}{\kwaen}{}%
\ifstreq{#1}{french}{\kwafr}{}%
2020-10-19 16:11:13 +02:00
}
2020-10-29 09:30:10 +01:00
% return key words (part b)
% 1: language
2020-10-19 16:11:13 +02:00
\newcommand{\kwb}[1]{%
2021-01-11 14:20:47 +01:00
\ifstreq{#1}{english}{\kwben}{}%
\ifstreq{#1}{french}{\kwbfr}{}%
2020-10-19 16:11:13 +02:00
}
2020-10-19 12:25:26 +02:00
2020-10-29 09:30:10 +01:00
% final variable kw
2020-10-19 16:27:51 +02:00
\ml
{\def\kw{\kwaen, \kwben}}
{\def\kw{\kwafr, \kwbfr}}
2020-10-29 09:30:10 +01:00
% set links and pdf metadata ───────────────────────────────────────────────────
2020-10-19 12:25:26 +02:00
\usepackage{hyperref}
\hypersetup{
pdfinfo={
Subject={\typelong},
2020-10-19 16:27:51 +02:00
Keywords={\kw},
2020-10-19 12:25:26 +02:00
},
}
2020-10-29 09:30:10 +01:00
% include settings ─────────────────────────────────────────────────────────────
2020-10-18 10:55:36 +02:00
\input{settings}
2020-10-29 09:30:10 +01:00
% begin document ───────────────────────────────────────────────────────────────
2020-10-18 01:53:11 +02:00
\begin{document}