Merge changes from the pandoc default latex template (#307)

- Merged with 144bf90ab9/data/templates/default.latex
- Rebuild the examples
- Rebuild the tests
- Add packages `hardwrap` and `catchfile` to build the broken example `title-page-background`
- Build with the latest pandoc 2.19.2
This commit is contained in:
Pascal Wagler 2022-11-24 23:26:34 +01:00 committed by GitHub
parent 3bc65a27fb
commit c255d9d4c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 103 additions and 92 deletions

View File

@ -11,7 +11,7 @@ jobs:
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Setup pandoc - name: Setup pandoc
env: env:
PANDOC_VERSION: "2.11.2" PANDOC_VERSION: "2.19.2"
run: | run: |
wget -qO- https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz | sudo tar xzf - --strip-components 1 -C /usr/local/ wget -qO- https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz | sudo tar xzf - --strip-components 1 -C /usr/local/
- name: Setup TexLive - name: Setup TexLive
@ -44,7 +44,7 @@ jobs:
pip install pandoc-latex-environment pip install pandoc-latex-environment
- name: Install LaTeX packages - name: Install LaTeX packages
run: | run: |
tlmgr install adjustbox background bidi csquotes footmisc footnotebackref fvextra mdframed pagecolor sourcecodepro sourcesanspro titling ulem upquote xurl tlmgr install adjustbox background bidi csquotes footmisc footnotebackref fvextra mdframed pagecolor sourcecodepro sourcesanspro titling ulem upquote xurl hardwrap catchfile
# trial and error # trial and error
tlmgr install letltxmacro zref everypage framed collectbox tlmgr install letltxmacro zref everypage framed collectbox
# packages needed for the template # packages needed for the template

View File

@ -3,7 +3,7 @@ dist: bionic
language: java language: java
before_install: before_install:
# default pandoc is too old -> install a newer version manually # default pandoc is too old -> install a newer version manually
- PANDOC_VERSION="2.11.2" - PANDOC_VERSION="2.19.2"
- pandoc_deb="pandoc-${PANDOC_VERSION}-1-amd64.deb" - pandoc_deb="pandoc-${PANDOC_VERSION}-1-amd64.deb"
- wget "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/${pandoc_deb}" - wget "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/${pandoc_deb}"
- sudo dpkg -i ${pandoc_deb} - sudo dpkg -i ${pandoc_deb}
@ -43,7 +43,7 @@ before_install:
- sudo chown -hR $(whoami) "$TEXLIVE_DIR" - sudo chown -hR $(whoami) "$TEXLIVE_DIR"
# packages specified in the template # packages specified in the template
- tlmgr install adjustbox background bidi csquotes footmisc footnotebackref fvextra mdframed pagecolor sourcecodepro sourcesanspro titling ulem upquote xurl - tlmgr install adjustbox background bidi csquotes footmisc footnotebackref fvextra mdframed pagecolor sourcecodepro sourcesanspro titling ulem upquote xurl hardwrap catchfile
# trial and error # trial and error
- tlmgr install letltxmacro zref everypage framed collectbox - tlmgr install letltxmacro zref everypage framed collectbox

View File

@ -44,11 +44,6 @@
\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref} \PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
\PassOptionsToPackage{hyphens}{url} \PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{dvipsnames,svgnames,x11names,table}{xcolor} \PassOptionsToPackage{dvipsnames,svgnames,x11names,table}{xcolor}
$if(dir)$
$if(latex-dir-rtl)$
\PassOptionsToPackage{RTLdocument}{bidi}
$endif$
$endif$
$if(CJKmainfont)$ $if(CJKmainfont)$
\PassOptionsToPackage{space}{xeCJK} \PassOptionsToPackage{space}{xeCJK}
$endif$ $endif$
@ -57,9 +52,6 @@ $endif$
$if(fontsize)$ $if(fontsize)$
$fontsize$, $fontsize$,
$endif$ $endif$
$if(lang)$
$babel-lang$,
$endif$
$if(papersize)$ $if(papersize)$
$papersize$paper, $papersize$paper,
$else$ $else$
@ -133,14 +125,11 @@ $if(beamerarticle)$
\usepackage{beamerarticle} % needs to be loaded first \usepackage{beamerarticle} % needs to be loaded first
$endif$ $endif$
\usepackage{amsmath,amssymb} \usepackage{amsmath,amssymb}
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
$if(linestretch)$ $if(linestretch)$
\usepackage{setspace} \usepackage{setspace}
$else$ $else$
% Use setspace anyway because we change the default line spacing.
% The spacing is changed early to affect the titlepage and the TOC.
\usepackage{setspace} \usepackage{setspace}
\setstretch{1.2} \setstretch{1.2}
$endif$ $endif$
@ -152,15 +141,48 @@ $endif$
\else % if luatex or xetex \else % if luatex or xetex
$if(mathspec)$ $if(mathspec)$
\ifXeTeX \ifXeTeX
\usepackage{mathspec} \usepackage{mathspec} % this also loads fontspec
\else \else
\usepackage{unicode-math} \usepackage{unicode-math} % this also loads fontspec
\fi \fi
$else$ $else$
\usepackage{unicode-math} \usepackage{unicode-math} % this also loads fontspec
$endif$ $endif$
\defaultfontfeatures{Scale=MatchLowercase} \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
$if(fontfamily)$
$else$
$-- Set default font before Beamer theme so the theme can override it
\usepackage{lmodern}
$endif$
$-- Set Beamer theme before user font settings so they can override theme
$if(beamer)$
$if(theme)$
\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
$endif$
$if(colortheme)$
\usecolortheme{$colortheme$}
$endif$
$if(fonttheme)$
\usefonttheme{$fonttheme$}
$endif$
$if(mainfont)$
\usefonttheme{serif} % use mainfont rather than sansfont for slide text
$endif$
$if(innertheme)$
\useinnertheme{$innertheme$}
$endif$
$if(outertheme)$
\useoutertheme{$outertheme$}
$endif$
$endif$
$-- User font settings (must come after default font and Beamer theme)
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$endif$
\ifPDFTeX\else
% xetex/luatex font selection
$if(mainfont)$ $if(mainfont)$
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$endif$ $endif$
@ -208,7 +230,7 @@ $if(zero-width-non-joiner)$
\def\zerowidthnonjoiner{% \def\zerowidthnonjoiner{%
% Prevent ligatures and adjust kerning, but still support hyphenating. % Prevent ligatures and adjust kerning, but still support hyphenating.
\texorpdfstring{% \texorpdfstring{%
\textormath{\nobreak\discretionary{-}{}{\kern.03em}% \TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}%
\ifvmode\else\nobreak\hskip\z@skip\fi}{}% \ifvmode\else\nobreak\hskip\z@skip\fi}{}%
}{}% }{}%
} }
@ -221,26 +243,6 @@ $if(zero-width-non-joiner)$
\fi \fi
%% End of ZWNJ support %% End of ZWNJ support
$endif$ $endif$
$if(beamer)$
$if(theme)$
\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
$endif$
$if(colortheme)$
\usecolortheme{$colortheme$}
$endif$
$if(fonttheme)$
\usefonttheme{$fonttheme$}
$endif$
$if(mainfont)$
\usefonttheme{serif} % use mainfont rather than sansfont for slide text
$endif$
$if(innertheme)$
\useinnertheme{$innertheme$}
$endif$
$if(outertheme)$
\useoutertheme{$outertheme$}
$endif$
$endif$
% Use upquote if available, for straight quotes in verbatim environments % Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{} \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available \IfFileExists{microtype.sty}{% use microtype if available
@ -268,7 +270,6 @@ $endif$
\definecolor{default-filecolor}{HTML}{A50000} \definecolor{default-filecolor}{HTML}{A50000}
\definecolor{default-citecolor}{HTML}{4077C0} \definecolor{default-citecolor}{HTML}{4077C0}
\definecolor{default-urlcolor}{HTML}{4077C0} \definecolor{default-urlcolor}{HTML}{4077C0}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
$if(footnotes-pretty)$ $if(footnotes-pretty)$
% load footmisc in order to customize footnotes (footmisc has to be loaded before hyperref, cf. https://tex.stackexchange.com/a/169124/144087) % load footmisc in order to customize footnotes (footmisc has to be loaded before hyperref, cf. https://tex.stackexchange.com/a/169124/144087)
\usepackage[hang,flushmargin,bottom,multiple]{footmisc} \usepackage[hang,flushmargin,bottom,multiple]{footmisc}
@ -277,38 +278,6 @@ $if(footnotes-pretty)$
\setlength{\skip\footins}{0.3cm} % set space between page content and footnote \setlength{\skip\footins}{0.3cm} % set space between page content and footnote
\setlength{\footskip}{0.9cm} % set space between footnote and page bottom \setlength{\footskip}{0.9cm} % set space between footnote and page bottom
$endif$ $endif$
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
$if(title-meta)$
pdftitle={$title-meta$},
$endif$
$if(author-meta)$
pdfauthor={$author-meta$},
$endif$
$if(lang)$
pdflang={$lang$},
$endif$
$if(subject)$
pdfsubject={$subject$},
$endif$
$if(keywords)$
pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
$endif$
$if(colorlinks)$
colorlinks=true,
linkcolor={$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$},
filecolor={$if(filecolor)$$filecolor$$else$default-filecolor$endif$},
citecolor={$if(citecolor)$$citecolor$$else$default-citecolor$endif$},
urlcolor={$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$},
$else$
hidelinks,
$endif$
breaklinks=true,
pdfcreator={LaTeX via pandoc with the Eisvogel template}}
\urlstyle{same} % disable monospaced font for URLs
$if(verbatim-in-note)$
\VerbatimFootnotes % allow verbatim text in footnotes
$endif$
$if(geometry)$ $if(geometry)$
$if(beamer)$ $if(beamer)$
\geometry{$for(geometry)$$geometry$$sep$,$endfor$} \geometry{$for(geometry)$$geometry$$sep$,$endfor$}
@ -399,15 +368,12 @@ $if(graphics)$
\def\fps@figure{htbp} \def\fps@figure{htbp}
\makeatother \makeatother
$endif$ $endif$
$if(links-as-notes)$ $if(svg)$
% Make links footnotes instead of hotlinks: \usepackage{svg}
\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
$endif$ $endif$
$if(strikeout)$ $if(strikeout)$
$-- also used for underline $-- also used for underline
\usepackage[normalem]{ulem} \usepackage{soul}
% Avoid problems with \sout in headers with hyperref
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
$endif$ $endif$
\setlength{\emergencystretch}{3em} % prevent overfull lines \setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{% \providecommand{\tightlist}{%
@ -459,23 +425,29 @@ $if(csl-refs)$
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break} \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$ $endif$
$for(header-includes)$
$header-includes$
$endfor$
$if(lang)$ $if(lang)$
\usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} \ifLuaTeX
\usepackage[bidi=basic]{babel}
\else
\usepackage[bidi=default]{babel}
\fi
$if(babel-lang)$
\babelprovide[main,import]{$babel-lang$}
$endif$
$for(babel-otherlangs)$
\babelprovide[import]{$babel-otherlangs$}
$endfor$
% get rid of language-specific shorthands (see #6817): % get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands \let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{} \def\languageshorthands#1{}
$endif$ $endif$
$for(header-includes)$
$header-includes$
$endfor$
\ifLuaTeX \ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures \usepackage{selnolig} % disable illegal ligatures
\fi \fi
$if(dir)$ $if(dir)$
\ifXeTeX
% Load bidi as late as possible as it modifies e.g. graphicx
\usepackage{bidi}
\fi
\ifPDFTeX \ifPDFTeX
\TeXXeTstate=1 \TeXXeTstate=1
\newcommand{\RL}[1]{\beginR #1\endR} \newcommand{\RL}[1]{\beginR #1\endR}
@ -500,7 +472,43 @@ $endif$
$if(csquotes)$ $if(csquotes)$
\usepackage{csquotes} \usepackage{csquotes}
$endif$ $endif$
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}
$if(links-as-notes)$
% Make links footnotes instead of hotlinks:
\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
$endif$
$if(verbatim-in-note)$
\VerbatimFootnotes % allow verbatim text in footnotes
$endif$
\hypersetup{
$if(title-meta)$
pdftitle={$title-meta$},
$endif$
$if(author-meta)$
pdfauthor={$author-meta$},
$endif$
$if(lang)$
pdflang={$lang$},
$endif$
$if(subject)$
pdfsubject={$subject$},
$endif$
$if(keywords)$
pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
$endif$
$if(colorlinks)$
colorlinks=true,
linkcolor={$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$},
filecolor={$if(filecolor)$$filecolor$$else$default-filecolor$endif$},
citecolor={$if(citecolor)$$citecolor$$else$default-citecolor$endif$},
urlcolor={$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$},
$else$
hidelinks,
$endif$
breaklinks=true,
pdfcreator={LaTeX via pandoc with the Eisvogel template}}
$if(title)$ $if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
$endif$ $endif$
@ -949,6 +957,9 @@ $endif$
$if(title)$ $if(title)$
$if(beamer)$ $if(beamer)$
\frame{\titlepage} \frame{\titlepage}
% don't generate the default title
% $else$
% \maketitle
$endif$ $endif$
$if(abstract)$ $if(abstract)$
\begin{abstract} \begin{abstract}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.