diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-03-04 11:28:24 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-03-04 11:29:41 -0800 |
commit | ebdcf752760aeb9c8f207fd17a28ae1a2fd945cf (patch) | |
tree | 1d8d4b953eb9646a36a57c1a73fa1477e2cdf2ec /data/templates | |
parent | 1de644783c6ae8c73c08ab428400caeb307ef90a (diff) | |
download | pandoc-ebdcf752760aeb9c8f207fd17a28ae1a2fd945cf.tar.gz |
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.
Diffstat (limited to 'data/templates')
-rw-r--r-- | data/templates/default.latex | 10 |
1 files changed, 5 insertions, 5 deletions
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$} |