This question already has an answer here:
- Conditional typesetting / build 7 answers
I have a project which compiles a document written in LaTeX, compiled to PDF with xelatex.
I would like to automatically produce 2 versions of the document:
A "confidential" version which all sections included and special page-headers which indicate that the document contains sensitive information.
A "redacted" version which includes a cover sheet explaining that the document has been redacted, no special headers, and those certain sections removed. It doesn't have to be blacked-out, but it would be nice if I could replace the text with something which indicates where a redaction has taken place.
I was thinking of implementing this with an additional pre-compilation step. I could easily write a Python script that prepares 2 versions of the .tex files, however, I was wondering if there's a more idiomatic way to solve this problem.
Does LaTeX have a method that would allow me to automatically include one thing or another thing depending on a command-line argument or an environment variable? Or is there some other more Texy way of solving this problem?