jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.02k stars 3.35k forks source link

Subtitle (from YAML header) not appearing in PDF when converting from markdow #3896

Closed dylan-chong closed 7 years ago

dylan-chong commented 7 years ago

Pandoc: 1.19.2.1, Mac OS X 10.11.6

markdown file (f.md)

---
title: Title
subtitle: Subtitle
author:
    - I am an author
date: \today{}
---

I am text

Output command

pandoc f.md -o f.pdf

Result

The subtitle is not shown in the PDF

screen shot 2017-09-06 at 7 10 27 pm
mb21 commented 7 years ago

From the MANUAL:

document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and Word docx; renders in LaTeX only when using a document class that supports \subtitle, such as beamer or the KOMA-Script series (scrartcl, scrreprt, scrbook)

thus try:

---
title: Title
subtitle: Subtitle
documentclass: scrartcl
---

text
stevegt commented 6 years ago

Thank You! Saved my life -- several hours of it, anyway.

You see, I'm one of them thar UNIX sysadmin types with the requisite 30 years of crotchety experience hacking around in arcane voodoo. I, too, saw that same paragraph in the manual yesterday, and I've spent the intervening hours trying to figure out what the heck a user is supposed to do. Latex docs, stack exchange, and the intertubes at large aren't much help with something this simple -- most latex conversation is between people writing masters theses, and is not specific enough to pandoc. Most of the examples I was able to find involve hacking around in the template, etc.

This is the only example I've been able to find that shows how to do this simply using pandoc YAML. It might be worth adding it to that paragraph in the manual.