I'm trying to learn how to programming in Latex. I want to make an if-else-statement. What I will do is something like this:
\def\x{2}
{
\if x =2
Yes
\else
no
\fi
}
But it doesn't work exactly how I imagine it would be. Any suggestions how to fix this minimal example?
\def\x{2}, use\ifnum\x=2Yes\else no\fi. – Mico Sep 17 '15 at 18:26\ifnum\x=2 Yes\else No\fia space after the two. If you have the code in different lines, the end of line acts as the space. – Manuel Sep 17 '15 at 18:28Can this be done ?
I can only make an if-else statement between the begin and end document.
– Simon Sep 19 '15 at 11:24