1

I write my worksheets with a package \usepackage{handout}. The package has a few options [solutions], [teachingnotes], [nospace].

I was wondering if there is a way to set up my compiler to produce the PDFs:

  • worksheet1.pdf,
  • worksheet1.solutions.pdf,
  • worksheet1teachingnotes.pdf, and
  • worksheetnospace.pdf

with one compile? Or can I change my header?

Stefan Pinnow
  • 29,535
  • 1
    Welcome to TeX.SX!Could you show us some code -> add a minimal working example (MWE), that illustrates your problem. It will be much easier when we see compilable code, starting with \documentclass and ending with \end{document}. Related question: https://tex.stackexchange.com/q/5228/124842 – Bobyandbob Jul 31 '17 at 13:52
  • If there is no TeX way to do that, I expect that a system batch/bash script could do it. Compile, change internal contents of tex file using sed, change tex file name, recompile. "Proof left to student." –  Jul 31 '17 at 14:47

1 Answers1

3

I don't know any way to do this directly with TeX, so you'll probably have to script this. But you don't need to change your .tex file in the script. Instead in the .tex file load the package without options. And in your script you can then write

pdflatex <options> "\PassOptionsToPackage{solutions}{handout}\input{worksheet1}"

Repeat this line as often as needed to get references, TOC, etc. right and then rename the pdf.

Mike
  • 8,664