Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dylan-chong opened this issue Sep 6, 2017 · 2 comments

Comments

@dylan-chong
Copy link

dylan-chong commented Sep 6, 2017

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

@dylan-chong dylan-chong changed the title Subtitle not appearing in PDF when converting from markdow Subtitle (from YAML header) not appearing in PDF when converting from markdow Sep 6, 2017
@mb21
Copy link
Collaborator

mb21 commented Sep 6, 2017

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

@mb21 mb21 closed this as completed Sep 6, 2017
@stevegt
Copy link

stevegt commented Sep 29, 2017

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.

jgm pushed a commit that referenced this issue Jan 11, 2019
Addresses closed issues #4675, #3896, #1327.

This renders `\subtitle` using the `etoolbox` package if `\subtitle` is not already
defined by the documentclass (as it is in beamer, KOMA, memoir classes).

 Based on an example from Enrico Gregorio, <https://tex.stackexchange.com/a/50186>.

Update list of LaTeX packages.

Note that `etoolbox` must be loaded outside the command definition.
Putting it inside causes an error if `\title` is placed after `\begin{document}`.
It's already loaded on LuaLaTeX/XeLaTeX in any case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants