I need to produce two document layouts using the same content. I'm going to be making heavy use of the input{} command to do this, but it is more complex than just this. I'm looking for suggestions how to best build the document.
I have 10 instruments, and each instrument has an intro, calibration, operation, post processing, and maintenance documentation section. So there are 50+ segments to this document.
One version needs to be arranged by instrument, like so:
- Doc Intro
- Instrument 1
- Intro
- Calib
- Ops...
- Instrument 2
- Intro
- Calib
etc.
I need a second version of the document that is arranged by order of operations, so:
- Doc Intro
- Calibration
- In 1
- In 2
- ...
- In 10
- Operations
- In 1
- In 2
etc.
As you can see, just writing a shell script to build a wrapper .tex document full of \input{} isn't enough, as each of the input-ed tex documents needs different headers, both depth and title, for example. What is a \subsection{Instrument 1} in one document becomes a \subsubsection{Calibration} in another document, although the exact same text is in the paragraphs below that.
I could have the shell script decide what is a subsection and what is a subsubsection too, but now I'm writing more bash then LaTeX.
Is there something for sections like the itemize environment? For itemize, I don't need to tell it how deep it is with itemitemitemize similar to subsubsubsection, it just handles it automagically.
Any other suggestions on how to best write once and compile twice will be much appreciated.