Pandoc md 到 pdf:在分页之前插入图像时保持顺序

Val*_*ich 2 pdf markdown image pdflatex pandoc

正如标题所述,我的问题是关于 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
Run Code Online (Sandbox Code Playgroud)

然后图像“更多文本”之后的文本显示在第一页上,并且图像被推送到第二页,这改变了我的内容的顺序。

我能做的就是

# Title

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

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

Some more text
Run Code Online (Sandbox Code Playgroud)

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

有没有真正的解决方案?也许是 YAML 标头中的设置?

我在谷歌上搜索了很多关于这个问题的信息,但没有找到解决方案。

谢谢 :)

Lui*_*ise 7

尝试pandoc从命令行进行渲染并停用implicit_figures选项,如下所示:

pandoc my_markdown.md -f markdown-implicit_figures -o rendered_md.pdf
Run Code Online (Sandbox Code Playgroud)

这样做的缺点是它删除了图中的标题。在标题中包含以下文本对我来说非常适合(也从这里复制):

\usepackage{float}
\let\origfigure\figure
\let\endorigfigure\endfigure
\renewenvironment{figure}[1][2] {
    \expandafter\origfigure\expandafter[H]
} {
    \endorigfigure
}
Run Code Online (Sandbox Code Playgroud)