Conditional compilation in a LaTeX document
I want to generalize a template I have and one of the items is setting a few variables before generating a PDF to send to someone.
In my Makefile开发者_如何转开发 I have set:
${OBJS}/main.pdf: main.tex ${DEPS}
pdflatex -output-directory=${OBJS} "\def\recipiant{${RECIPIANT}} \def\revision{${REVISION}} \include{main}"
Though I would like to not worry about those variables for reviews.. I figured I could do something like \ifdef but it isn't working out... any ideas how I can generalize this template conditionally?
\ifdef\recipiant
\fancyfoot[CE,CO]{prepared for \recipiant \ (revision \revision) }
\else
\fancyfoot[CE,CO]{REVIEW}
\fi
I use \ifx
to achieve this
\ifx\recipiant\undefined
\fancyfoot[CE,CO]{REVIEW}
\else
\fancyfoot[CE,CO]{prepared for \recipiant \ (revision \revision) }
\fi
精彩评论