Pandoc MD to PDF , full size horizontal rule
Asked Answered
Q

3

10

I'm using pandoc (on windows with miktex)

with markdown i create a horizontal rule, save that as my source.md

---

(or even an hr tag instead)

but when I convert to PDF the horizontal rule is a tiny little line in the middle of the page, centered.

How do I get it to create one from margin to margin like it does when I convert it to HTML?

Edit:

I tried a CSS styled DIV tag that creates a rule but it is completely ignored during a pdf output.

Quartile answered 4/9, 2014 at 4:47 Comment(0)
B
8

As pointed above, you can redefine the \rule command in your custom LaTeX template to ignore the first argument:

\let\OldRule\rule
\renewcommand{\rule}[2]{\OldRule{\linewidth}{#2}}
Breannabreanne answered 18/11, 2015 at 11:47 Comment(0)
S
5

Try $\hrulefill$. This worked for me.

Sewel answered 3/6, 2021 at 17:23 Comment(0)
R
3

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.

Other than that, using ConTeXt instead of LaTeX already results in a full-size horizontal rule.

Rejection answered 5/9, 2014 at 12:32 Comment(1)
I only get "cannot produce pdf output with context writer", and google has no fix for that, trying to redefine rule though.Quartile

© 2022 - 2024 — McMap. All rights reserved.