Preserve line breaks in title using pandoc

A. Donda picture A. Donda · Feb 2, 2015 · Viewed 7.4k times · Source

Consider the following title block in pandoc-flavored Markdown:

% Higgelty Pigglety Pop!
  or
  There Must Be More to Life
% Maurice Sendak

Here, line breaks are part of the title. It is possible to reformat the title in order to insert it into regular text flow, e.g. "Higgelty Pigglety Pop! Or, There Must Be More to Life", but when not talked about but used on the title page of a document, preserving the line breaks is crucial. Depending on the style, it might look like this:

          Higgelty Pigglety Pop!
                   or
        There Must Be More to Life
             Maurice Sendak

My question: How can I achieve a proper multi-line title display in the output of pandoc?

A portable version would be preferred, but I'd also be content with a LaTeX-only hack.

Answer

Chris picture Chris · Feb 2, 2015
% Higgelty Pigglety Pop! \
  or \
  There Must Be More to Life
% Maurice Sendak

Pandoc Markdown enables the escaped_line_breaks extension by default:

A backslash followed by a newline is also a hard line break. Note: in multiline and grid table cells, this is the only way to create a hard line break, since trailing spaces in the cells are ignored.