C programmers often use constructs like
#ifdef foo
printf("foo is defined ");
#endif
#ifndef foo
printf("foo is not defined ");
#endif
to select certain code-paths during the compilation process, by passing the compiler flag like -Dfoo or just sticking a #define foo 0 somewhere in the code.
Is this possible in LaTeX too? So I am looking for something like
\ifdef foo{
short summary, tldr
}
\ifndef foo{
long explanation
}
This can be particularly helpful for producing short summary documents from existing TeX files containing long descriptions. I would like to be able to pass
something similar to -Dfoo as a compiler flag, or just define the foo somewhere near the top of the Latex file, just as I would do in the C case.