1

I'm using texify and am trying to set a macro from the command line. Here is my sample .tex file:

\documentclass{article} 
%\newcommand{\version}{1.3} 
\title{test \version} 
\begin{document}
\maketitle The current version \version\ is stable 
\end{document}

Instead of hardcoding version I'd like to set it from the command line. Here is the command line I used, but it didn't work:

texify --pdf --synctex=1 --clean --tex-option="\def\version{1.5}" Test_version_numbers.tex

Is there another way to do this that texify understands?

Any help is greatly appreciated!

3
  • Welcome! I do not use texify, but the answer will depend on the operating system and which shell are you using for the command line. For example, to do what you are trying to do, in linux with zsh you have to do pdflatex "\\def\\version{1.5}\\input{lilla.tex}", doubling the backslash to avoid the shell processing of them. Moreover, you can give just one command to the engine, so probably choosing an option is not gonna work (but I do not know texify, so maybe I'm wrong)
    – Rmano
    Apr 20 at 18:07
  • Hi, I'm using MiKTeX on a Windows machine, and I'm calling the command from within Git Bash. Looking in TeXWorks, it gave me it's command line calls. Apr 20 at 18:30
  • I found something that DOES work, don't know if it is the most efficient: texify --pdf --synctex=1 --clean --tex-option="\AtBeginDocument{\def\version{1.5}}\input{filename.tex}" filename.tex Apr 20 at 18:30

0

You must log in to answer this question.

Browse other questions tagged .