Pandoc Markdown到PDF图像的位置 [英] Pandoc Markdown to PDF image position
问题描述
使用pandoc将Markdown文档转换为PDF时,我的图像放置的位置与源代码中放置的位置不同.我相信这是由于通过LaTeX进行的转换,但是我不确定如何在Markdown源代码中对此进行补救.
When converting a Markdown document to PDF with pandoc, my images are not placed in the same position I put them in the source code. I believe this is due to the conversion through LaTeX, but I'm not sure how to remedy this in the Markdown source.
如果我使用带有几段示例文本的占位符图像并将其策略性地放置在源代码中,该图像将变得太大而无法放在我放置该图像的位置的页面上,因此LaTeX布局引擎会很好地放置该图像在下一页上.但是,我宁愿没有发生这种情况,因为这意味着该图像不在我期望的位置,并且更难引用.
If I use a placeholder image with several paragraphs of sample text and strategically place the image in the source, it becomes too big to fit on the page in the place where I've put it, so the LaTeX layout engine kindly places it on the next page. However, I'd rather this didn't happen because it means the image isn't where I expect and is harder to reference.
如有必要,我可以提供一个示例,但复制起来很繁琐,并且源代码在某种程度上需要覆盖整个页面.
I can include an example if necessary, but it's trivial to reproduce and the source needs to be somewhat extensive to fill an entire page.
推荐答案
您尝试停用
pandoc -f markdown-implicit_figures -t pdf myfile.md
要解决大小问题,您还可以尝试使用属性在markdown文件中修复大小.这样的事情可以解决问题:
To solve the size problem you could also try to fix the size within the markdown file with an attribute. Something like that can do the trick:
![Caption text](/path/to/image){ width=50% }
这篇关于Pandoc Markdown到PDF图像的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!