I am moving myself from using LyX to just coding in LaTeX. I've been able to research and figure out a lot of things on my own, but there's one feature in LyX that I'd like to be able to code in LaTeX that simply has me stumped: document branching.
What I'm trying to do is similar to writing an exam in LaTeX where you have the copy for the students and the answer key; however, I'd like to do this in an article, report, or book where I can suppress some text (sentences, paragraphs, sections, etc.) giving me the ability to create public and private versions of the document by changing a line of code the preamble.
If someone could put me on the trail of an article that explains how to do this I would be grateful. I'm just not turning anything up when I search.