I wrote a simple makefile to compile my latex code.
I have some variables in that makefile and I want to pass them to the latex code, but I don't know how to do that.
Example 1:
in makefile:
# set Type to A or B
Type = B
in latex code:
\ifdefined\B
%%%%%%%%%%%%%%%Some LaTeX Code%%%%%%%%%%%%%%%
\else
\ifdefined\A
%%%%%%%%%%%%%%%Some LaTeX Code%%%%%%%%%%%%%%%
\fi
\fi
Example 2:
in makefile:
Version = J
in LaTeX code:
Some random text \Version
Here is the line in the makefile that I use for compilation:
latexmk -lualatex -output-directory=$(OUTDIR) --jobname=$(REPORT_PDF) $(REPORT)
Any help?
typeAtestortypeBtest.Then it can be checked whether the expansion of\jobnamebegins with "typeA" or "typeB". (With older latexmk-releases you may need-latexoption="-jobname=...".) Since in TeX the names of the output files (.pdf/.log/.aux) also depend on the jobname, the makefile should rename the output files as desired when LaTeX is finished. – Ulrich Diez Nov 15 '21 at 14:54