简体   繁体   中英

Changing font size in Pandoc generated PDF document

I'm trying to change the font size in a Pandoc generated PDF document using a yaml. The settings are made in layout.yaml template below;

---
title: "Core Concepts in Mechanics"
geometry: margin=3cm
fontsize: 20pts
output: pdf_document
...

I then call Pandoc as below

Pandoc --latex-engine=pdflatex -s -o CoreConceptsInMechanics.pdf CoreConceptsInMechanics.md layout.yaml

The font size does not change at all. The rest of the settings work. What am I doing wrong?

The yaml metadata block is supposed to go at the top of your markdown file.

The standard LaTeX document classes support only 3 different font sizes, 10pt , 11pt and 12pt (note that it's not 12pts ). If you need larger fontsizes you have to specify a different class, eg

---
fontsize: 20pt
documentclass: extreport
...

# My title

my doc

Finally, if you want it to be in two different files, the order is important AFAIK, it should be:

pandoc -o output.pdf layout.yaml CoreConceptsInMechanics.md

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM