我可以在 \include 中使用 \input 嗎?

我可以在 \include 中使用 \input 嗎?

我知道不可能將一個嵌套\include在另一個中,但是呢\input?是否有可能有類似的東西:

\documentclass{article}

\begin{document}

\include{file1}

\end{document}

然後在file1.tex

\section{samplesection}
\input{file2}

file2.tex;

\section{samplesection2}
Hello

答案1

引用科普卡和戴利的話,LaTeX 指南,第 4 版(2004 年),第 14 頁。 207:

\include命令不能嵌套:它們只能出現在主處理文件中。然而,\input命令可以在 d.txt 檔案中給出\include

相關內容