Pandoc 和 html5 以巨大的利润率导出 pdf [英] Pandoc and html5 exporting pdf's with huge margins

查看:35
本文介绍了Pandoc 和 html5 以巨大的利润率导出 pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我是第一次尝试 Pandoc.一切看起来都很好,但是当通过 html5 (wkhtmltopdf) 导出时,我的 pdf 输出在所有方面都有很大的边距.

So I'm trying Pandoc for the first time. Everything seems great but when exporting via html5 (wkhtmltopdf) my pdf output is saved with huge margins on all sides.

pandoc -t html5 -s example.md -o output.pdf

output.pdf(以红色突出显示的内容输出)

output.pdf (content output highlighted in red)

我尝试过的:

  • 重新安装 pdflatex
  • 重新安装 wkhtmltopdf
  • 包括 CSS 以删除边距

我错过了什么吗?

我想要的:使用 Typora 写一个 Markdown 文档 -> 使用 Pandoc 应用 TOC 和页码 -> 使用 html5 导出带有自定义的 pdf造型.

What I want: Write a markdown document using Typora -> Use Pandoc to apply TOC and page numbering -> Use html5 to export pdf with custom styling.

推荐答案

这些用于 wkhtmltopdf 的 pass through vars 对我有用(ubuntu 18.10 pandoc 2.6):https://pandoc.org/MANUAL.html#variables-for-wkhtmltopdf

These pass through vars for wkhtmltopdf worked for me (ubuntu 18.10 pandoc 2.6) : https://pandoc.org/MANUAL.html#variables-for-wkhtmltopdf

pandoc -t html5 -V margin-top=3 -V margin-left=3 -V margin-right=3 -V margin-bottom=3 -V papersize=letter -s example.md -o输出.pdf

(奇怪的是 wkhtmltopdf 要求所有边距都相同.)

(Oddly wkhtmltopdf required all margins be the same.)

这篇关于Pandoc 和 html5 以巨大的利润率导出 pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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