Is it possible to compile two different pdf outputs from the same .tex
file?
For example, let's say I have a document main.tex
which contains questions for students,
and answers only for teachers, which I want to hide from the students.
Is it possible to compile the student and teacher versions of the document
from the command line with different options?
pdflatex '\documentversion{student}' main -o student.pdf # output is student.pdf
pdflatex '\documentversion{teacher}' main -o teacher.pdf # output is teacher.pdf