From ebdcf752760aeb9c8f207fd17a28ae1a2fd945cf Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Mar 2019 11:28:24 -0800 Subject: LaTeX writer/template: better handling of front/main/backmatter. In pandoc 2.7 we assumed that every class with chapters would accept `\frontmatter`, `\mainmatter`, and `\backmatter`. This is not so (e.g. report does not). So pandoc 2.7 breaks on report class by including an unsupported command. So we replace the book-class variable in the template with two variables, has-chapters and has-frontmatter, and set these intelligently in the writer. Closes #5348. --- data/templates/default.latex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'data') diff --git a/data/templates/default.latex b/data/templates/default.latex index aacb48bba..b76562f7b 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -383,10 +383,10 @@ $endif$ $endif$ \begin{document} -$if(title)$ -$if(book-class)$ +$if(has-frontmatter)$ \frontmatter $endif$ +$if(title)$ $if(beamer)$ \frame{\titlepage} $else$ @@ -430,18 +430,18 @@ $endif$ $if(lof)$ \listoffigures $endif$ -$if(book-class)$ +$if(has-frontmatter)$ \mainmatter $endif$ $body$ -$if(book-class)$ +$if(has-frontmatter)$ \backmatter $endif$ $if(natbib)$ $if(bibliography)$ $if(biblio-title)$ -$if(book-class)$ +$if(has-chapters)$ \renewcommand\bibname{$biblio-title$} $else$ \renewcommand\refname{$biblio-title$} -- cgit v1.2.3