Pandoc MD到PDF,全尺寸水平尺 [英] Pandoc MD to PDF , full size horizontal rule
问题描述
我正在使用pandoc(在带有miktex的Windows上)
I'm using pandoc (on windows with miktex)
使用markdown创建一个水平线,将其另存为source.md
with markdown i create a horizontal rule, save that as my source.md
---
(甚至是hr标签)
但是当我转换为PDF时,水平规则是页面中间的一条细小线,居中.
but when I convert to PDF the horizontal rule is a tiny little line in the middle of the page, centered.
如何像在将其转换为HTML时一样,从一个边缘到另一个边缘创建一个?
How do I get it to create one from margin to margin like it does when I convert it to HTML?
我尝试了CSS样式的DIV标签,该标签创建了规则,但在pdf输出期间被完全忽略了.
I tried a CSS styled DIV tag that creates a rule but it is completely ignored during a pdf output.
推荐答案
使用pandoc -t latex
时,水平尺会生成LaTeX代码\begin{center}\rule{3in}{0.4pt}\end{center}
.因此,您可以尝试在自定义中重新定义 \rule
命令href ="http://johnmacfarlane.net/pandoc/README.html#templates" rel ="nofollow noreferrer"> Pandoc模板.
The horizontal rule produces the LaTeX code \begin{center}\rule{3in}{0.4pt}\end{center}
when using pandoc -t latex
. So you might try to redefine the \rule
command in your custom Pandoc template.
除此之外,使用ConTeXt代替LaTeX已经产生了完整尺寸的水平尺.
Other than that, using ConTeXt instead of LaTeX already results in a full-size horizontal rule.
这篇关于Pandoc MD到PDF,全尺寸水平尺的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!