Pandoc md到pdf:在分页符之前插入图像时保持顺序 [英] Pandoc md to pdf: keep order when inserting image before pagebreak

查看:241
本文介绍了Pandoc md到pdf:在分页符之前插入图像时保持顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所述,我的问题是关于pandocs md到pdf.

as the title states, my question is about pandocs md to pdf.

当我转换降价标记时

# Title

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

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

Some more text

然后在第一页上显示图像更多文本"之后的文本,然后将图像推送到第二页,这将更改我的内容顺序.

then the text after the image "some more text" is displayed on the first page and the image gets pushed to the second page, which changes the order of my content.

我能做的是类似的事情

# Title

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

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

Some more text

但是维护起来很烦人,因为当我想在开始时添加内容时,我必须检查是否仍然需要\newpage,如果我必须在其他地方添加另一个.

But that is very annoying to maintain, because when i want to add content to the start afterwards i have to check if the \newpage is still neccessary there of if i have to add another one somewhere else.

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

Is there any real solution for this? Maybe a setting in the YAML header?

我已经在Google上搜索了很多,但是没有找到解决方案.

I have googled alot about this but didnt come across a solution.

谢谢:)

推荐答案

尝试通过pandoc从命令行和,如下所示:

Try rendering with pandoc from the command line and deactivating the implicit_figures option, as in:

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

它的缺点是它会从图形中删除标题.在标题中包含以下tex对我来说非常合适(从此处):

This comes with the downside that it removes captions from figures. Including the following tex in the header works perfectly for me (copied from here as well):

\usepackage{float}
\let\origfigure\figure
\let\endorigfigure\endfigure
\renewenvironment{figure}[1][2] {
    \expandafter\origfigure\expandafter[H]
} {
    \endorigfigure
}

这篇关于Pandoc md到pdf:在分页符之前插入图像时保持顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆