为了同时获得三个输出文件(通过一次编译),我添加了选项--shell-escape
和
\ifx\conditionmacro\undefined
\immediate\write18{%
pdflatex --jobname="\jobname"
"\gdef\string\conditionmacro{1}\string\input\space\jobname"
}%
\immediate\write18{%
pdflatex --jobname="\jobname_halb"
"\gdef\string\conditionmacro{2}\string\input\space\jobname"
}%
\immediate\write18{%
pdflatex --jobname="\jobname_voll"
"\gdef\string\conditionmacro{3}\string\input\space\jobname"
}%
\expandafter\stop
\fi
回到我的前言,但现在不再显示错误,并且失败的编译过程没有停止。我怎样才能再次实现正常行为?
更新
此示例有效并生成三个不同的输出文件:
\documentclass{article}
\usepackage{tagging}
\ifx\conditionmacro\undefined
\immediate\write18{%
pdflatex --jobname="\jobname"
"\gdef\string\conditionmacro{1}\string\input\space\jobname"
}%
\immediate\write18{%
pdflatex --jobname="\jobname_halb"
"\gdef\string\conditionmacro{2}\string\input\space\jobname"
}%
\immediate\write18{%
pdflatex --jobname="\jobname_voll"
"\gdef\string\conditionmacro{3}\string\input\space\jobname"
}%
\expandafter\stop
\fi
\ifnum\conditionmacro>1 \usetag{halb}\fi
\ifnum\conditionmacro=3 \usetag{voll}\fi
\begin{document}
test
\tagged{halb}{test-halb}
\tagged{voll}{test-voll}
\end{document}
这个当然不行,但是它没有停止进程并显示错误(就像 TeXstudio 的正常行为一样),而是卡住了:
\documentclass{article}
\usepackage{tagging}
\ifx\conditionmacro\undefined
\immediate\write18{%
pdflatex --jobname="\jobname"
"\gdef\string\conditionmacro{1}\string\input\space\jobname"
}%
\immediate\write18{%
pdflatex --jobname="\jobname_halb"
"\gdef\string\conditionmacro{2}\string\input\space\jobname"
}%
\immediate\write18{%
pdflatex --jobname="\jobname_voll"
"\gdef\string\conditionmacro{3}\string\input\space\jobname"
}%
\expandafter\stop
\fi
\ifnum\conditionmacro>1 \usetag{halb}\fi
\ifnum\conditionmacro=3 \usetag{voll}\fi
\begin{document}
test
\tagged{halb}{test-halb}
\tagged{voll}{test-voll}
}
\end{document}
我想保留 TeXstudio 的惯常行为。