I use this method which works ok for me. I have a file called switch.tex where the switch
is set to true or false. I have to edit this file to change the switch. Then in the main latex
document, I input this file. This diagram shows the process.
\ifbool{switch} {.... latex code to compile when switch is true....} {.... latex code to compile when switch is false....}