I'd like to have different versions of my document. So far I built the document such that I only have to change


to the version number I'd like and the respective document is compiled. However, I'd like that the document is compiled mutliple times automatically and with different \setversion-parameter. Is that possible and how?

I am using pdflatex by the way.

I found out that there are

but I got kind of confuse how to do my simple case.


pdflatex '\newcommand{\setversion}{2}\input{yourfile}'
  • 3
    a commandline of pdflatex '\newcommand\setversion}{2}\input{yourfile}' – David Carlisle Jan 12 '16 at 18:12
  • @DavidCarlisle: While compiling my document with kile is no problem, your command has a couple of problems with my tikz-constructions. Not sure why. E.g. Package pgfkeys Error: I do not know the key '/tikz/semi thick' and I am goin g to ignore it. Perhaps you misspelled it. – Make42 Jan 12 '16 at 22:47
  • 1
    that is presumably an error in your document when the version is set to 2, impossible to say without an example – David Carlisle Jan 12 '16 at 23:31
  • The key is semithick and not semi thick. No matter how you compile it, the latter will always give that error. – cfr Jan 13 '16 at 0:55
  • 1
    @DavidCarlisle: Putting this question on hold is kind of iritating. Your answer pdflatex '\newcommand{\setversion}{2}\input{yourfile}' was perfectly fine - I just wanted to accept it as an answer. – Make42 Jan 21 '16 at 20:17

Browse other questions tagged or ask your own question.