23 lines
1 KiB
TeX
23 lines
1 KiB
TeX
|
% Switches.
|
||
|
\newif\ifPhoto % Show photo.
|
||
|
\newif\ifExtra % Show extra content.
|
||
|
\newif\ifEn % English language.
|
||
|
\newif\ifRu % Russian language.
|
||
|
\newcommand{\En}[1]{\ifEn#1\fi} % Print if English language.
|
||
|
\newcommand{\Ru}[1]{\ifRu#1\fi} % Print if Russian language.
|
||
|
|
||
|
% Read env variables.
|
||
|
\def\envTrue{true} % True.
|
||
|
\def\envFalse{false} % False.
|
||
|
\def\envEn{en} % English literal.
|
||
|
\def\envRu{ru} % Russian literal.
|
||
|
\def\envEmpty{} % Empty env value.
|
||
|
\GetEnv[\envPhoto]{DOCUMENT_PHOTO} % Read photo shell variable.
|
||
|
\GetEnv[\envExtra]{DOCUMENT_EXTRA} % Read extra shell variable.
|
||
|
\GetEnv[\envLang]{DOCUMENT_LANG} % Read language shell variable.
|
||
|
\ifdefequal{\envPhoto}{\envTrue}{\Phototrue}{\Photofalse} % Show photo.
|
||
|
\ifdefequal{\envExtra}{\envTrue}{\Extratrue}{\Extrafalse} % Show extra content.
|
||
|
\ifdefequal{\envLang}{\envEn}{\Entrue}{} % Use English.
|
||
|
\ifdefequal{\envLang}{\envRu}{\Rutrue}{} % Use Russian.
|
||
|
\ifdefequal{\envLang}{\envEmpty}{\Entrue}{} % Use English by default.
|