I would like a LaTeX source file to compile in different ways depending on the job name. However, when I run pdflatex mwe
with mwe.tex
containing
\documentclass{article}
\begin{document}
\ifx{mwe}\jobname
true
\else
false.\jobname.
\fi
\def\mwe{mwe}
\ifx\mwe\jobname
true
\else
false.\jobname.\mwe.
\fi
\end{document}
the resulting pdf file is "false.mwe. false.mwe.mwe.", while I expected to see "true". What am I doing wrong?
\edef\x{\detokenize{mwe}} \edef\y{\jobname} \ifx\x\y...
to compare using\ifx