\usepackage{ifthen} %% preamble \newboolean{BoolVar} \setboolean{BoolVar}{true} \ifthenelse{\boolean{BoolVar}}{1}{2}