aboutsummaryrefslogtreecommitdiff
path: root/data/templates/default.latex
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-04 11:28:24 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-04 11:29:41 -0800
commitebdcf752760aeb9c8f207fd17a28ae1a2fd945cf (patch)
tree1d8d4b953eb9646a36a57c1a73fa1477e2cdf2ec /data/templates/default.latex
parent1de644783c6ae8c73c08ab428400caeb307ef90a (diff)
downloadpandoc-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/default.latex')
-rw-r--r--data/templates/default.latex10
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$}