来自子文件夹和子子文件夹的 LaTeX 输入

来自子文件夹和子子文件夹的 LaTeX 输入

虽然我已经阅读了很多关于从子文件夹导入 LaTeX 的帖子,但我找不到解决我的问题的方法,希望你能帮助我。

我正在处理一个大型 LaTeX 文件,其中包含几个之前创建的报告。现在我想将它们合并起来,但命令总是出现问题\input

以下是我需要使用的文件夹结构:主文件夹包含“large_report.tex”,子文件夹名为“reports”。此子文件夹中有多个报告文件夹,如“report1”、“report2”等。每个报告文件夹中都有一个文件“reportX.tex”(其中 X 是当前报告的编号),还有两个文件夹,分别名为“sections”和“figures”。我试图在这里弄清楚这个结构(抱歉在文件夹之前命名了文件,但这样更清楚):

/
|
|- large_report.tex
|
|- reports
  |- report1
  | |- sections
  |   | - section1.tex
  |   | - section2.tex
  |   | - section3.tex
  | |- figures
  |   | - figure1.pdf
  |   | - figure2.pdf
  |   | - figure3.pdf
  | |- report1.tex

  |- report2
  | |- sections
  |   | - sectionA.tex
  |   | - sectionB.tex
  |   | - sectionC.tex
  | |- figures
  |   | - figureA.pdf
  |   | - figureB.pdf
  |   | - figureC.pdf
  | |- report2.tex

  |- more reports...

|- more folders...

线索是:每个reportX.tex用于\input{sectionY}包含文件夹中的文件sections并且在这些部分文件(sectionZ.tex)中都有\includegraphic类似的命令\includegraphic{figures/figureA}

最后,应该使用 large_report.tex,\include{reports/report1.tex}但这会为 reports1.tex 及其部分文件的每个引用引发错误。

我找到了创建“MyPath”-makros 的解决方案,但据我所知,这对于所有报告路径都是必要的,对吗?另外,我需要重命名所有部分文件中的所有路径。

也许我在这里忽略了一些东西,你会说,这种结构无论如何都是荒谬的。但是,有没有比重命名所有路径更简单的解决方案?

顺便说一句,我在 Windows 上使用 TeXstudio (pdflatex)。

相关内容