问题描述
我正在 markdown
中写入文本以管道输入 pandoc
以生成 html
和 tex
文件。
这适用于单个文件和链接的 html 文件。
现在我想使用主文件构建多个 tex 文件的单个 pdf,该主文件使用 \include{foo}
调用 tex 文件。
每个 .tex
文件都有完整的前导码时失败了。
我如何告诉 pandoc 生成一个 includable tex 文件? 还是我走错了路?如果是这样,我如何将多个降价文件中的 pdf 拼接在一起?
解决方法
我刚刚意识到我的 -s
命令中仍然有 pandoc
选项。
没有它,pandoc 只生成文本正文,一切正常。
奖励:其实是想用\input{foo}
可以在几个latex文件上携带label。
您不需要“可包含的”文档,有几个 Latex 类和包允许您包含带有完整序言的文档,例如docmute
:
\documentclass{article}
\usepackage{docmute}
\begin{document}
test
\include{document} % document with full preamble
\end{document}
(或查看其中一些 https://www.ctan.org/recommendations/combine )
或者,如果您已经拥有各个文档的 pdf 文件,您可以使用 pdfpages
包将它们拼接在一起。