Pandoc 将带有图像的 md 转换为 pdf

时间:2021-06-03 15:30:40

标签: pdf terminal markdown pandoc file-conversion

我的 md 文件包含图像列表,例如:

<块引用>

"! [image-9H7092HQ.jpg] (Beginners_Russian_with_Interactive_Online_Workbook/image-9H7092HQ.jpg)"

<块引用>

"! [image-EVZX3ID8.jpg] (Beginners_Russian_with_Interactive_Online_Workbook/image-EVZX3ID8.jpg)"

(“!”和“[”之间没有空格,“]”和“(”) 图像位于与 md 文件相同的另一个文件中。

我跑了

pandoc -f markdown -t pdf Beginners_Russian_with_Interactive_Online_Workbook.md

在终端上,但它给了我错误:

Error producing PDF.
! LaTeX Error: Too many unprocessed floats.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.378 \centering

然后我跑了

H <return> 

它返回 zsh: parse error near `\n'

我不确定出了什么问题。以及如何将带有图像的 md 文件转换为 pdf。如果有人可以帮助我,我将不胜感激。谢谢。


主要问题已修复,但输出文件存在尺寸问题(见下文) enter image description here

1 个答案:

答案 0 :(得分:0)

可能的问题是 pandoc 将没有周围文本的图像转换为数字。试试

pandoc -f markdown-implicit_figures -t latex -o OUTFILE.pdf YOUR-FILE.md

那应该禁用此功能并解决问题。