2

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

\newcommand{\setversion}{0}

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.

Solution:

pdflatex '\newcommand{\setversion}{2}\input{yourfile}'
Make42
  • 1,772
  • 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 00:55
  • @cfr: I checked. You are right, it is semithick. Fun fact though: While it does not work using the pdflatex-command, it does work when I use Kile! – Make42 Jan 13 '16 at 11:09
  • That's not a fun fact. That's misinformation, however sincerely you believe it. Kile does not compile your document. It can't. It is only an editor. It runs some binary with some arguments to compile your .tex file. Probably pdflatex by default. But no TeX engine will magically cause a PGF key to be recognised which has not been defined. Unless it is using different packages and you somewhere define this as a custom key and that definition is somehow loaded when Kile's command is executed but not when you run pdflatex.... Have you ill-advisedly set Kile's compile to continue past errors? – cfr Jan 13 '16 at 20:39
  • @cfr: Sorry, I expressed myself imprecise: I meant that when I compile it from Kile. I am well aware that Kile uses pdflatex. I didn't deliberately, searched for the settings, couldn't find it? Do you know were it is found? – Make42 Jan 14 '16 at 10:56
  • @DavidCarlisle: Do you want to put this in an answer, to get accepted? – Make42 Jan 18 '16 at 15:57
  • If you mean my comment that the question appears to be unanswerable no, If you fixed it that's good but I suggest we just close this as unclear in that case. – David Carlisle Jan 18 '16 at 16:41
  • 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
  • sorry about that, still no harm done, you got the answer you needed. I'm sure the technique of defining a macro before input is already on site so once that was clearly what was meant the question would probably have been closed as duplicate anyway. – David Carlisle Jan 21 '16 at 21:25
  • @DavidCarlisle: I like to accept some answer - if only to be able to track which of my problems still needs solving. – Make42 Jan 23 '16 at 10:51

0 Answers0