在其他文档中包含完整的 LaTeX 文档
我目前正在完成我的论文,并且希望能够在我的 LaTeX 文档中包含一些文档。
我想要包含的文件是用 LaTeX 向我的主管完成的每周报告。 显然,所有文档都单独编号。 我希望将它们包含在最终文件中。
我可以使用 GhostScript 或其他一些工具连接所有最终的 PDF,但我希望整个文档的编号保持一致。
我尝试过将每个文档中的 LaTeX 包含在主文档中,但是序言等会导致问题,并且每个报告中的小标题占据一整页......
总之,我正在寻找一种包含数字的方法大型报告中的 1 或 2 页自完成 LaTeX 文件,保留其原始布局,但更改页码。
I'm currently finishing off my dissertation, and would like to be able to include some documents within my LaTeX document.
The files I'd like to include are weekly reports done in LaTeX to my supervisor. Obviously all documents are page numbered seperately.
I would like them to be included in the final document.
I could concatenate all the final PDFs using GhostScript or some other tool, but I would like to have consistent numbering throughout the document.
I have tried including the LaTeX from each document in the main document, but the preamble etc causes problems and the small title I have in each report takes a whole page...
In summary, I'm looking for a way of including a number of 1 or 2 page self-complete LaTeX files in a large report, keeping their original layouts, but changing the page numbering.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于
\input
-ing 原始 LaTeX 文件同时跳过其序言的可能解决方案, newinclude 包可能会有所帮助。否则,您可以使用 pdfpages 将预先存在的 PDF 插入到您的论文中。 我好像记得它有一个功能,就是用白框覆盖原来的页码,从而“抑制”它们。
For a possible solution of
\input
-ing the original LaTeX files while skipping their preamble, the newclude package might help.Otherwise, you can use pdfpages for inserting pre-existing PDFs into your dissertation. I seem to recall that it has a feature of "suppressing" the original page numbers by covering them up with white boxes.
@Will Robertson 的建议非常有效。 我只想为所有懒惰的人添加一个示例:
从包的文档中:
pages={4-9}
。 如果省略 start,则默认为第一页;如果省略 end,则默认为最后一页。landscape=true
The suggestion from @Will Robertson works great. I'd just like to add an example for all lazy people:
From the documentation of the package:
pages={4-9}
. If start is omitted, it defaults to the first page, if end is omitted, it defaults to the last page.landscape=true
如果它们使用不同的格式,则维护每个文档的原始格式将很困难。 例如,连接不同的文档类几乎是不可能的。
我建议您使用稍作修改的 GhostScript 解决方案。 Latex 允许您使用 \setcounter{page}{13} 设置起始页码。 如果您能找到一个可以计算 PDF 文档页数的应用程序(Ubuntu 软件包 pdfjam 中的 pdfinfo 就是一个例子),那么您可以执行以下操作:
如果您需要进行任何其他处理,请再次使用 sed。 您应该(假设您修复了上述算法中的无限循环;-))最终得到一个最终的 PDF 文档,其中所有原始 PDF 都连接在一起并具有连续的行号。
Maintaining the original formatting per document will be difficult if they're using different formats. For example, concatenating different document classes will be near impossible.
I would suggest you go with the GhostScript solution with a slight twist. Latex allows you to set the starting page number using \setcounter{page}{13} for example. If you can find an application that can count the pages of a PDF document (pdfinfo in the pdfjam Ubuntu package is one example), then you can do the following:
If you need to do any other processing, again use sed. You should (assuming you fix the infinite loop in the above algorithm ;-) ) end up with a final PDF document with all original PDFs concatenated and continuous line numbers.
看看 combine 包,它似乎是正是您正在寻找的内容。
由于它在源级别合并文档,我猜页码是正确的。
Have a look a the combine package, which seems to be exactly what you're searching for.
Since it merges documents at the source level, I guess the page numbers will be correct.