Say you have two versions of the same LaTeX document.
For instance, you have one version of your lecture slides for actually delivering a lecture: as you're really not a big fan of the "wall of text", this version would be parsimonious in terms of text content, allowing the audience to listen to what you're talking about instead of reading the slides, and giving graphical content centre stage.
Another version of those slides, made available to the audience after the lecture, for self-study, would be more self-contained and include a summary of what you said during that lecture along with the graphical content mentioned above.
Consider that you can toggle between the two versions by either changing a class option or by changing the value of some dedicated counter in your input file; something relatively simple to do "by hand".
To produce two different versions of the same document, my current workflow is
- "manually" compile the first version,
- change the filename of the output produced (in order to prevent overwriting in step 4)
- make appropriate changes in my input file to switch to the second version,
- "manually" compile the second version.
However, this workflow is tedious and error-prone, especially when the number of different versions increases. I would like to automate it as much as possible. Is there a way to batch compile all the versions of my document, each getting a different output filename?
I guess that would involve modifying the input file at the command line (I'm on Mac OS X), but I don't know how to do that.
Do you have an automated workflow for compiling multiple versions of the same document? How do you do it?
Edit: I figured it out using Martin Scharrer's post and Neil Olver's post on Passing parameters to a document, of which my question is a duplicate.
Sweave
and then call theR
file withPython
through Ubuntu terminal, passing commands through asubprocess.Popen
function throughPython
.R
file? I'm not using anyR
file...R
language to automate the entire process. Set up aSweave
document then toggle the generate of the LaTeX document by simply twiddling a few parameters in yourSweave
script (in fact completely ignorePython
andUbuntu
for now. Just focus onSweave
andR
.