0

User case: This is what I have in mind. I am preparing a contract written in tex. I would like to specify in the beginning of the contract whether this will be an open contract. if so, I want text to add section{ABC}, if not, then section ABC is not executated.

I know there are similar questions asked, but to be honest, it is too confusing and I still don't know how to proceed after doing my research. I assume I should use \if primitive?

Some pseydocode I have in mind

\newcommand{\opencontract}{TRUE}

...
\if \opencontract=TRUE
\section{ABC}
***
\fi
...
1
  • Other possibility: see “Boolean Flags” in the etoolbox manual.
    – frougon
    Commented Jul 17, 2021 at 12:03

1 Answer 1

3
\newif\ifopencontract

in your preamble then

\opencontracttrue

or

\opencontractfalse

then

\ifopencontract
  whatever
 \else
   foobar
\fi

in conditional sections

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .