I am trying to add a a couple of authors to a report I am writing. Preferably, the second author would appear on a new line after the first. I know I can modify the template to add a new field or the multiple author example given in the Pandoc readme. However, I wonder if there is any character I can use to insert a new line between authors directly in the metablock. So far I have tried \newline
, \\
, |
with newline and space, <br>
, <div></div>
, and making the author list a string with newline or double spaces between author names, but nothing has worked. My desired output is pdf.
Asked
Active
Viewed 4,213 times
2

joelostblom
- 43,590
- 17
- 150
- 159
2 Answers
3
The problem isn't in the YAML metadata formatting (for which there are numerous ways to have multiline strings), but that the LaTeX \author
command strips the newlines. But for PDF output (with LaTeX) you can do:
---
title: mytitle
author: '\protect\parbox{\textwidth}{\protect\centering Author: 1\\ Author: 2\\ Author 3}'
---
body text
-
Ah ok that makes sense, thanks. Do you also know how to include a colon in the author name? So that the first line would read `Author 1` and the second line `Supervisor: Author 2`. When I try to quote or escape it, quotations marks are either included in the output or pandoc thinks I have a `Supervisor:` meta tag. – joelostblom Sep 11 '15 at 15:16
-
if you want to use colons, you have to wrap the YAML value in quotes, updated the answer. – mb21 Sep 11 '15 at 15:23
2
You can go with a simple list to achieve this.
---
title: 'Any title comes here'
author:
- Author One
- Author Two
---
Another way is to rely on the title block that has a slightly different syntax.
% Any title comes here
% author(s) (separated by semicolons)
% date
Find additional variants in the metadata-block section of the pandoc manual.

unused
- 796
- 4
- 12