aboutsummaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorAndrew Dunning <adunning@users.noreply.github.com>2019-04-02 20:18:36 -0400
committerJohn MacFarlane <jgm@berkeley.edu>2019-04-02 18:18:36 -0600
commit3d1409347a221ee79de568627892eab16c5198d4 (patch)
treea8661ccf957328027e10e05ada9df208c6c33727 /data/templates
parent40b60a911c222a00407726d5ce606abbafcea29c (diff)
downloadpandoc-3d1409347a221ee79de568627892eab16c5198d4.tar.gz
LaTeX template: Ensure correct heading/table order (#5421)
Improve the workaround for #1658, adapting a solution by @u-fischer in <https://github.com/latex3/latex2e/issues/131> that works whether or not the `indent` variable is enabled. Remove `subparagraph` variable in LaTeX template. The default is now to use run-in style for level 4 and 5 headings (`\paragraph` and `\subparagraph`). To get the previous default behavior (where these were formatted as blocks, like `\subsubsection`), set the `block-headings` variable. An example is given in the manual of reformatting the appearance of headings more thoroughly using KOMA-Script. Closes #5365.
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/default.latex15
1 files changed, 9 insertions, 6 deletions
diff --git a/data/templates/default.latex b/data/templates/default.latex
index 25fc26107..336aeb367 100644
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -99,7 +99,7 @@ $endif$
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
\usepackage[utf8]{inputenc}
- \usepackage{textcomp} % provides euro and other symbols
+ \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
$if(mathspec)$
\ifxetex
@@ -223,7 +223,7 @@ $endif$
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
$if(verbatim-in-note)$
-\VerbatimFootnotes % allows verbatim text in footnotes
+\VerbatimFootnotes % allow verbatim text in footnotes
$endif$
$if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
@@ -252,6 +252,11 @@ $if(beamer)$
\def\fnum@table{\tablename~\thetable}
\makeatother
$else$
+% Correct order of tables after \paragraph or \subparagraph
+\usepackage{etoolbox}
+\makeatletter
+\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
+\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
@@ -291,9 +296,8 @@ $else$
$endif$
$if(beamer)$
$else$
-$if(subparagraph)$
-$else$
-% Redefines (sub)paragraphs to behave more like sections
+$if(block-headings)$
+% Make \paragraph and \subparagraph free-standing
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
@@ -307,7 +311,6 @@ $endif$
$if(pagestyle)$
\pagestyle{$pagestyle$}
$endif$
-
$for(header-includes)$
$header-includes$
$endfor$