编译多个 .tex 文件

编译多个 .tex 文件

我有多个 .tex 文件(例如 1.tex、2.tex、3.tex 等),它们不包含前言或 \begin{document} \end{document} 命令。

每个.tex 文件的内容遵循以下简单结构。

Item 1.
This line contains information for item 1.
This line contains resources for item 1.
Item 2.
This line contains information for item 2.
This line contains resources for item 2.
Item 3.
This line contains information for item 3.
This line contains resources for item 3.
.
.
.

我想将所有这些 .tex 文件编译为多个 .tex 文件,而不是单个 .tex 文件。基本上我想要的是每个 .tex 文件的 pdf(1.pdf、2.pdf、3.pdf 等等)。

我尝试过的是:


\documentclass{article}

\begin{document}
\input{1} % I need item 1 (all three lines), 2, 3 and so on to be wrapped around \begin{equation} \end{equation}
\input{2}% I need item 1, 2, 3 and so on to be wrapped around \begin{equation} \end{equation}
\input{3}% I need item 1, 2, 3 and so on to be wrapped around \begin{equation} \end{equation}
\end{document}

上述代码的问题是:

  1. 它将其编译为一个 pdf。
  2. 我需要将所有这些项目(属于该项目的所有三行)包裹在 \begin{equation} \end{equation} 周围
  3. 将这些文件编译成它们自己的pdf。

我不确定它是否可在 LaTeX 中执行,或者我应该使用 python 来运行这种类型的工作流程。

相关内容