From 28b2d86b2113c0b03c480dbd7e6fbad1d4a1053f Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Sat, 19 Dec 2015 18:29:55 -0800 Subject: [PATCH] LaTeX/Beamer template changes (Thomas Hodgson): * Added `thanks` variable * Use `parskip.sty` when `indent` isn't set (fall back to using `setlength` as before if `parskip.sty` isn't available). * Use `biblio-style` with biblatex. * Added `biblatexoptions` variable. * Added `section-titles` variable (defaults to true) to enable/suppress section title pages in beamer slide shows. * Moved beamer themes after fonts, so that themes can change fonts. (Previously the fonts set were being clobbered by lmodern.sty.) --- README | 13 ++++++++++++- data/templates | 2 +- src/Text/Pandoc/Writers/LaTeX.hs | 1 + tests/lhs-test.latex | 4 ++++ tests/lhs-test.latex+lhs | 4 ++++ tests/writer.latex | 4 ++++ tests/writers-lang-and-dir.latex | 4 ++++ 7 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README b/README index 5bc6231e3..8e753003d 100644 --- a/README +++ b/README @@ -1138,6 +1138,10 @@ including all [reveal.js configuration options]. (default is `empty` for no navigation symbols; other valid values are `frame`, `vertical`, and `horizontal`). +`section-titles` +: enables on "title pages" for new sections in `beamer` + documents (default = true). + [reveal.js configuration options]: https://github.com/hakimel/reveal.js#configuration Variables for LaTeX @@ -1208,6 +1212,9 @@ LaTeX variables are used when [creating a PDF]. : disables default behavior of LaTeX template that redefines (sub)paragraphs as sections, changing the appearance of nested headings in some classes +`thanks` +: specifies contents of acknowledgments footnote after document title. + `toc` : include table of contents (can also be set using `--toc/--table-of-contents`) @@ -1221,7 +1228,11 @@ LaTeX variables are used when [creating a PDF]. : bibliography to use for resolving references `biblio-style` -: bibliography style, when used with `--natbib` +: bibliography style, when used with `--natbib` and + `--biblatex`. + +`biblatex-options` +: list of options for biblatex. [`article`]: https://ctan.org/pkg/article [`report`]: https://ctan.org/pkg/report diff --git a/data/templates b/data/templates index 617e2af70..7e91df709 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit 617e2af70c7d429a44d3b116d49d4b05840059e9 +Subproject commit 7e91df709abffc08b41e9fc5b437fb049898cc13 diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 8814bb57e..31feecc7c 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -195,6 +195,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do defField "dir" (if (null $ query (extract "dir") blocks) then ""::String else "ltr") $ + defField "section-titles" True $ metadata let toPolyObj lang = object [ "name" .= T.pack name , "options" .= T.pack opts ] diff --git a/tests/lhs-test.latex b/tests/lhs-test.latex index 1df84c0cb..a5b0ff87f 100644 --- a/tests/lhs-test.latex +++ b/tests/lhs-test.latex @@ -64,8 +64,12 @@ \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} \newcommand{\NormalTok}[1]{{#1}} +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} +} \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} diff --git a/tests/lhs-test.latex+lhs b/tests/lhs-test.latex+lhs index 471c9698b..8ab9a2ef0 100644 --- a/tests/lhs-test.latex+lhs +++ b/tests/lhs-test.latex+lhs @@ -28,8 +28,12 @@ \urlstyle{same} % don't use monospace font for urls \usepackage{listings} \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} +} \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} diff --git a/tests/writer.latex b/tests/writer.latex index ced46f808..7e7a02f58 100644 --- a/tests/writer.latex +++ b/tests/writer.latex @@ -42,8 +42,12 @@ \usepackage[normalem]{ulem} % avoid problems with \sout in headers with hyperref: \pdfstringdefDisableCommands{\renewcommand{\sout}{}} +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} +} \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} diff --git a/tests/writers-lang-and-dir.latex b/tests/writers-lang-and-dir.latex index 8a8433592..2f1ee4fbe 100644 --- a/tests/writers-lang-and-dir.latex +++ b/tests/writers-lang-and-dir.latex @@ -46,8 +46,12 @@ \setotherlanguage[]{spanish} \setotherlanguage[]{french} \fi +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} +} \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}