我有一篇论文,其中所有章节都有一个通用的宏文件。我不想在我的论文中加载此文件,因为它是从封面后面的文件cover.tex
中加载的。thesis.tex
\input{cover}
我该如何做到这一点?
答案1
这似乎是不明智的:
\documentclass{article}
% the filecontents package allows for a self-contained example...
\usepackage{filecontents}
\begin{filecontents*}{\jobname.sty}
\newcommand\test[1]{\textbf{#1}}
\end{filecontents*}
\begin{filecontents*}{\jobname-input.tex}
This macro will fail: \verb|\test{what?}|.
Uncomment to test: % \test{what?}
\end{filecontents*}
\begin{document}
\input{\jobname-input} % <-- can't use \test here
OK, now load file
\input \jobname.sty
\input{\jobname-input} % <-- could use \test here
This macro won't fail: \test{when?}
\end{document}