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.
|