Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.13k stars 959 forks source link

Completely disable footers and headers separately #379

Open GregoryKogan opened 6 months ago

GregoryKogan commented 6 months ago

Hello! I really like this template, but I'm having an issue with the headers and footers.

In my case, I need a header but not a footer. However, the disable-header-and-footer option turns off both, and I haven't found a way to turn off just the footer.

I attempted a solution from this issue, setting footer-left and footer-right to "\\\ ". This, however, only partially resolves the problem. The footer is still there, it's just empty. I want to get rid of it completely.

empty footer

I also tried to fix it by changing the margins, but that didn't work.

Is there a way to completely get rid of the footer while keeping the header?

UPD: I managed to remove footer by setting bottom margin to 0.4cm in metadata.yaml file:

geometry: "left=2cm, right=2cm, top=2cm, bottom=0.4cm"

But the result is looking very weird...

image
GregoryKogan commented 6 months ago

UPD: SUCCESS! After reading through geometry package documentation I found footskip and headsep options. To disable footers just set footskip to something relatively larger than bottom margin and to disable headers set headsep to something larger than top margin. This will push footers/headers out of the page.
No footers

# metadata.yaml
geometry: "left=2cm, right=2cm, top=2cm, bottom=2cm, footskip=5cm"

No headers

# metadata.yaml
geometry: "left=2cm, right=2cm, top=2cm, bottom=2cm, headsep=5cm"

Here is an example of a page with a header and without a footer, while keeping margins.

image