I use XelaTeX to produce my CV.
Currently, I want to update it and have both Slovak and English CV within one document.
I want to have all strings of one language grouped in the preamble, same for the other. (That is, I don’t want to have the string after \begin{document}
).
I want to create \cvlang
using \def \cvlang {sk} % Options: en | sk
. This way I can switch between languages quite easily.
Now, I have no idea, how to check what is the current value of the \cvlang
. I want to create something like this (if
syntax borrowed from Javascript; incorporated some TeX commands):
if (\cvlang == "sk"){
\def \lgdatebirthplace {Dátum a miesto\\ narodenia}
\def \lgaddress {Adresa}
\def \lgphone {Telefón}
\def \lgemail {Email}
}else if{
\def \lgdatebirthplace {Date and place of birth}
\def \lgaddress {Address}
\def \lgphone {Phone}
\def \lgemail {Email}
}
I don’t care about the package/command/syntax—it can be anything.
I tried to use ifthen
package, but I’ve some errors at PDF compilation:
\usepackage{ifthen}
\ifthenelse{\equal{\lang}{sk}}{
\def \lgdatebirthplace {Dátum a miesto\\ narodenia}
\def \lgaddress {Adresa}
\def \lgphone {Telefón}
\def \lgemail {Email}
}{
\def \lgdatebirthplace {Date and place of birth}
\def \lgaddress {Address}
\def \lgphone {Phone}
\def \lgemail {Email}
}%
I tried to use pdftexcmds
package, however, this does not work either:
% \usepackage{pdftexcmds}
% \ifnum\pdf@strcmp{\cvlang}{sk}{
\def \lgdatebirthplace {Dátum a miesto\\ narodenia}
\def \lgaddress {Adresa}
\def \lgphone {Telefón}
\def \lgemail {Email}
\else
\def \lgdatebirthplace {Date and place of birth}
\def \lgaddress {Address}
\def \lgphone {Phone}
\def \lgemail {Email}
\fi
Questions and answers I checked and tried to implement: - On testing two fully expanded character strings for equality
PS—I am quite new to TeX and I have never used any conditionals in it.