【问题标题】:Pandoc md to pdf: keep order when inserting image before pagebreakPandoc md to pdf:在分页符之前插入图像时保持顺序
【发布时间】:2020-01-31 08:23:23
【问题描述】:

正如标题所述,我的问题是关于 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

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

我能做的就是

# 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】:

尝试从命令行使用pandocdeactivating the implicit_figures option 进行渲染,如下所示:

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

它的缺点是它会从数字中删除标题。在标题中包含以下 tex 非常适合我(也从 here 复制):

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

【讨论】:

  • 我编辑,从另一个线程添加了额外的解决方案并批准了答案。谢谢。
猜你喜欢
  • 1970-01-01
  • 2021-08-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多