Pandoc md to pdf:在分页前插入图片时要保持顺序。

问题描述 投票:1回答:1

如标题所述,我的问题是关于pandocs md转pdf。

当我把一个标记转换为

# Title

...... text that is about a 3/4 page

![image that is too large to fit page](image.png)

Some more text

然后图片后的文字 "some more text "显示在第一页,图片被推到第二页,这改变了我的内容顺序。

我可以做的是这样的

# Title

...... text that is about a 3/4 page

\newpage
![image that is too large to fit page](image.png)

Some more text

但这是非常烦人的维护,因为当我想添加内容到开始后,我必须检查是否有 \newpage 如果我必须在其他地方添加另一个,仍然是必要的。

有什么真正的解决方案吗?也许在YAML头的设置?

我已经谷歌了很多关于这一点,但没有遇到一个解决方案。

谢谢:)

image pdf markdown pandoc pdflatex
1个回答
2
投票

尝试渲染 pandoc 从命令行和 停用 implicit_figures 选项。,因为。

pandoc my_markdown.md -f markdown-implicit_figures -o rendered_md.pdf

这样做的缺点是,它会删除数字的标题。在页眉中加入以下文字对我来说是完美的(复制自 此处 也是)。)

\usepackage{float}
\let\origfigure\figure
\let\endorigfigure\endfigure
\renewenvironment{figure}[1][2] {
    \expandafter\origfigure\expandafter[H]
} {
    \endorigfigure
}
© www.soinside.com 2019 - 2024. All rights reserved.