git.iko.soy/typeable/pandoc
on master help sign in
LaTeX template: Improve readability (#5363)
bbe2da3Andrew Dunning
data/templates/default.latex+19−18
@@ -1,4 +1,5 @@
1+% Options for packages loaded elsewhere
1−\PassOptionsToPackage{unicode=true$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref} % options for packages loaded elsewhere
2+\PassOptionsToPackage{unicode=true$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
2\PassOptionsToPackage{hyphens}{url}
3\PassOptionsToPackage{hyphens}{url}
3$if(colorlinks)$
4$if(colorlinks)$
4\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
5\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
@@ -46,7 +47,7 @@ $endif$
46$for(beameroption)$
47$for(beameroption)$
47\setbeameroption{$beameroption$}
48\setbeameroption{$beameroption$}
48$endfor$
49$endfor$
49−% Prevent slide breaks in the middle of a paragraph:
50+% Prevent slide breaks in the middle of a paragraph
50\widowpenalties 1 10000
51\widowpenalties 1 10000
51\raggedbottom
52\raggedbottom
52$if(section-titles)$
53$if(section-titles)$
@@ -173,7 +174,7 @@ $if(outertheme)$
173\useoutertheme{$outertheme$}
174\useoutertheme{$outertheme$}
174$endif$
175$endif$
175$endif$
176$endif$
176−% use upquote if available, for straight quotes in verbatim environments
177+% Use upquote if available, for straight quotes in verbatim environments
177\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
178\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
178\IfFileExists{microtype.sty}{% use microtype if available
179\IfFileExists{microtype.sty}{% use microtype if available
179 \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
180 \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
@@ -218,10 +219,10 @@ $if(colorlinks)$
218 citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
219 citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
219 urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
220 urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
220$else$
221$else$
221− pdfborder={0 0 0},
222+ hidelinks,
222$endif$
223$endif$
223− breaklinks=true}
224+}
224−\urlstyle{same} % don't use monospace font for urls
225+\urlstyle{same} % disable monospaced font for URLs
225$if(verbatim-in-note)$
226$if(verbatim-in-note)$
226\VerbatimFootnotes % allows verbatim text in footnotes
227\VerbatimFootnotes % allows verbatim text in footnotes
227$endif$
228$endif$
@@ -247,7 +248,7 @@ $if(tables)$
247\usepackage{longtable,booktabs}
248\usepackage{longtable,booktabs}
248$if(beamer)$
249$if(beamer)$
249\usepackage{caption}
250\usepackage{caption}
250−% These lines are needed to make table captions work with longtable:
251+% Make caption package work with longtable
251\makeatletter
252\makeatletter
252\def\fnum@table{\tablename~\thetable}
253\def\fnum@table{\tablename~\thetable}
253\makeatother
254\makeatother
@@ -274,10 +275,10 @@ $if(links-as-notes)$
274$endif$
275$endif$
275$if(strikeout)$
276$if(strikeout)$
276\usepackage[normalem]{ulem}
277\usepackage[normalem]{ulem}
277−% avoid problems with \sout in headers with hyperref:
278+% Avoid problems with \sout in headers with hyperref
278\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
279\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
279$endif$
280$endif$
280−\setlength{\emergencystretch}{3em} % prevent overfull lines
281+\setlength{\emergencystretch}{3em} % prevent overfull lines
281\providecommand{\tightlist}{%
282\providecommand{\tightlist}{%
282 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
283 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
283$if(numbersections)$
284$if(numbersections)$
@@ -304,7 +305,7 @@ $if(pagestyle)$
304\pagestyle{$pagestyle$}
305\pagestyle{$pagestyle$}
305$endif$
306$endif$
306
307
307−% set default figure placement to htbp
308+% Set default figure placement to htbp
308\makeatletter
309\makeatletter
309\def\fps@figure{htbp}
310\def\fps@figure{htbp}
310\makeatother
311\makeatother
@@ -313,23 +314,23 @@ $for(header-includes)$
313$header-includes$
314$header-includes$
314$endfor$
315$endfor$
315$if(lang)$
316$if(lang)$
316−\ifnum 0\ifxetex 1\fi=0 % if pdftex or luatex
317+\ifxetex
317− \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
318−$if(babel-newcommands)$
319− $babel-newcommands$
320−$endif$
321−\else % if xetex
322− % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
318+ % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
323 \usepackage{polyglossia}
319 \usepackage{polyglossia}
324 \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
320 \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
325$for(polyglossia-otherlangs)$
321$for(polyglossia-otherlangs)$
326 \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
322 \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
327$endfor$
323$endfor$
324+\else
325+ \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
326+$if(babel-newcommands)$
327+ $babel-newcommands$
328+$endif$
328\fi
329\fi
329$endif$
330$endif$
330$if(dir)$
331$if(dir)$
331\ifxetex
332\ifxetex
332− % load bidi as late as possible as it modifies e.g. graphicx
333+ % Load bidi as late as possible as it modifies e.g. graphicx
333 \usepackage{bidi}
334 \usepackage{bidi}
334\fi
335\fi
335\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
336\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
test/lhs-test.latex+8−7
@@ -1,4 +1,5 @@
1+% Options for packages loaded elsewhere
1−\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
2+\PassOptionsToPackage{unicode=true}{hyperref}
2\PassOptionsToPackage{hyphens}{url}
3\PassOptionsToPackage{hyphens}{url}
3%
4%
4\documentclass[
5\documentclass[
@@ -15,7 +16,7 @@
15 \defaultfontfeatures{Scale=MatchLowercase}
16 \defaultfontfeatures{Scale=MatchLowercase}
16 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
17 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
17\fi
18\fi
18−% use upquote if available, for straight quotes in verbatim environments
19+% Use upquote if available, for straight quotes in verbatim environments
19\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
20\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
20\IfFileExists{microtype.sty}{% use microtype if available
21\IfFileExists{microtype.sty}{% use microtype if available
21 \usepackage[]{microtype}
22 \usepackage[]{microtype}
@@ -35,9 +36,9 @@
35\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
36\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
36\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
37\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
37\hypersetup{
38\hypersetup{
38− pdfborder={0 0 0},
39+ hidelinks,
39− breaklinks=true}
40+}
40−\urlstyle{same} % don't use monospace font for urls
41+\urlstyle{same} % disable monospaced font for URLs
41\usepackage{color}
42\usepackage{color}
42\usepackage{fancyvrb}
43\usepackage{fancyvrb}
43\newcommand{\VerbBar}{|}
44\newcommand{\VerbBar}{|}
@@ -76,7 +77,7 @@
76\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
77\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
77\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
78\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
78\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
79\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
79−\setlength{\emergencystretch}{3em} % prevent overfull lines
80+\setlength{\emergencystretch}{3em} % prevent overfull lines
80\providecommand{\tightlist}{%
81\providecommand{\tightlist}{%
81 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
82 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
82\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
83\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
@@ -90,7 +91,7 @@
90 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
91 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
91\fi
92\fi
92
93
93−% set default figure placement to htbp
94+% Set default figure placement to htbp
94\makeatletter
95\makeatletter
95\def\fps@figure{htbp}
96\def\fps@figure{htbp}
96\makeatother
97\makeatother
test/lhs-test.latex+lhs+8−7
@@ -1,4 +1,5 @@
1+% Options for packages loaded elsewhere
1−\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
2+\PassOptionsToPackage{unicode=true}{hyperref}
2\PassOptionsToPackage{hyphens}{url}
3\PassOptionsToPackage{hyphens}{url}
3%
4%
4\documentclass[
5\documentclass[
@@ -15,7 +16,7 @@
15 \defaultfontfeatures{Scale=MatchLowercase}
16 \defaultfontfeatures{Scale=MatchLowercase}
16 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
17 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
17\fi
18\fi
18−% use upquote if available, for straight quotes in verbatim environments
19+% Use upquote if available, for straight quotes in verbatim environments
19\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
20\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
20\IfFileExists{microtype.sty}{% use microtype if available
21\IfFileExists{microtype.sty}{% use microtype if available
21 \usepackage[]{microtype}
22 \usepackage[]{microtype}
@@ -35,15 +36,15 @@
35\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
36\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
36\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
37\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
37\hypersetup{
38\hypersetup{
38− pdfborder={0 0 0},
39+ hidelinks,
39− breaklinks=true}
40+}
40−\urlstyle{same} % don't use monospace font for urls
41+\urlstyle{same} % disable monospaced font for URLs
41\usepackage{listings}
42\usepackage{listings}
42\newcommand{\passthrough}[1]{#1}
43\newcommand{\passthrough}[1]{#1}
43\lstset{defaultdialect=[5.3]Lua}
44\lstset{defaultdialect=[5.3]Lua}
44\lstset{defaultdialect=[x86masm]Assembler}
45\lstset{defaultdialect=[x86masm]Assembler}
45\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
46\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
46−\setlength{\emergencystretch}{3em} % prevent overfull lines
47+\setlength{\emergencystretch}{3em} % prevent overfull lines
47\providecommand{\tightlist}{%
48\providecommand{\tightlist}{%
48 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
49 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
49\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
50\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
@@ -57,7 +58,7 @@
57 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
58 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
58\fi
59\fi
59
60
60−% set default figure placement to htbp
61+% Set default figure placement to htbp
61\makeatletter
62\makeatletter
62\def\fps@figure{htbp}
63\def\fps@figure{htbp}
63\makeatother
64\makeatother
test/writer.latex+9−8
@@ -1,4 +1,5 @@
1+% Options for packages loaded elsewhere
1−\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
2+\PassOptionsToPackage{unicode=true}{hyperref}
2\PassOptionsToPackage{hyphens}{url}
3\PassOptionsToPackage{hyphens}{url}
3%
4%
4\documentclass[
5\documentclass[
@@ -15,7 +16,7 @@
15 \defaultfontfeatures{Scale=MatchLowercase}
16 \defaultfontfeatures{Scale=MatchLowercase}
16 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
17 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
17\fi
18\fi
18−% use upquote if available, for straight quotes in verbatim environments
19+% Use upquote if available, for straight quotes in verbatim environments
19\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
20\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
20\IfFileExists{microtype.sty}{% use microtype if available
21\IfFileExists{microtype.sty}{% use microtype if available
21 \usepackage[]{microtype}
22 \usepackage[]{microtype}
@@ -38,9 +39,9 @@
38\hypersetup{
39\hypersetup{
39 pdftitle={Pandoc Test Suite},
40 pdftitle={Pandoc Test Suite},
40 pdfauthor={John MacFarlane; Anonymous},
41 pdfauthor={John MacFarlane; Anonymous},
41− pdfborder={0 0 0},
42+ hidelinks,
42− breaklinks=true}
43+}
43−\urlstyle{same} % don't use monospace font for urls
44+\urlstyle{same} % disable monospaced font for URLs
44\VerbatimFootnotes % allows verbatim text in footnotes
45\VerbatimFootnotes % allows verbatim text in footnotes
45\usepackage{graphicx,grffile}
46\usepackage{graphicx,grffile}
46\makeatletter
47\makeatletter
@@ -52,9 +53,9 @@
52% using explicit options in \includegraphics[width, height, ...]{}
53% using explicit options in \includegraphics[width, height, ...]{}
53\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
54\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
54\usepackage[normalem]{ulem}
55\usepackage[normalem]{ulem}
55−% avoid problems with \sout in headers with hyperref:
56+% Avoid problems with \sout in headers with hyperref
56\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
57\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
57−\setlength{\emergencystretch}{3em} % prevent overfull lines
58+\setlength{\emergencystretch}{3em} % prevent overfull lines
58\providecommand{\tightlist}{%
59\providecommand{\tightlist}{%
59 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
60 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
60\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
61\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
@@ -68,7 +69,7 @@
68 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
69 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
69\fi
70\fi
70
71
71−% set default figure placement to htbp
72+% Set default figure placement to htbp
72\makeatletter
73\makeatletter
73\def\fps@figure{htbp}
74\def\fps@figure{htbp}
74\makeatother
75\makeatother
test/writers-lang-and-dir.latex+19−18
@@ -1,4 +1,5 @@
1+% Options for packages loaded elsewhere
1−\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
2+\PassOptionsToPackage{unicode=true}{hyperref}
2\PassOptionsToPackage{hyphens}{url}
3\PassOptionsToPackage{hyphens}{url}
3%
4%
4\documentclass[
5\documentclass[
@@ -16,7 +17,7 @@
16 \defaultfontfeatures{Scale=MatchLowercase}
17 \defaultfontfeatures{Scale=MatchLowercase}
17 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
18 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
18\fi
19\fi
19−% use upquote if available, for straight quotes in verbatim environments
20+% Use upquote if available, for straight quotes in verbatim environments
20\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
21\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
21\IfFileExists{microtype.sty}{% use microtype if available
22\IfFileExists{microtype.sty}{% use microtype if available
22 \usepackage[]{microtype}
23 \usepackage[]{microtype}
@@ -36,10 +37,10 @@
36\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
37\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
37\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
38\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
38\hypersetup{
39\hypersetup{
39− pdfborder={0 0 0},
40+ hidelinks,
40− breaklinks=true}
41+}
41−\urlstyle{same} % don't use monospace font for urls
42+\urlstyle{same} % disable monospaced font for URLs
42−\setlength{\emergencystretch}{3em} % prevent overfull lines
43+\setlength{\emergencystretch}{3em} % prevent overfull lines
43\providecommand{\tightlist}{%
44\providecommand{\tightlist}{%
44 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
45 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
45\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
46\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
@@ -53,12 +54,21 @@
53 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
54 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
54\fi
55\fi
55
56
56−% set default figure placement to htbp
57+% Set default figure placement to htbp
57\makeatletter
58\makeatletter
58\def\fps@figure{htbp}
59\def\fps@figure{htbp}
59\makeatother
60\makeatother
60
61
61−\ifnum 0\ifxetex 1\fi=0 % if pdftex or luatex
62+\ifxetex
63+ % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
64+ \usepackage{polyglossia}
65+ \setmainlanguage[]{english}
66+ \setotherlanguage[]{german}
67+ \setotherlanguage[variant=british]{english}
68+ \setotherlanguage[variant=swiss]{german}
69+ \setotherlanguage[]{spanish}
70+ \setotherlanguage[]{french}
71+\else
62 \usepackage[shorthands=off,ngerman,british,nswissgerman,spanish,french,main=english]{babel}
72 \usepackage[shorthands=off,ngerman,british,nswissgerman,spanish,french,main=english]{babel}
63 \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}}
73 \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}}
64 \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
74 \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
@@ -69,18 +79,9 @@
69 \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}}
79 \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}}
70 \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
80 \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
71 \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
81 \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
72−\else % if xetex
73− % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
74− \usepackage{polyglossia}
75− \setmainlanguage[]{english}
76− \setotherlanguage[]{german}
77− \setotherlanguage[variant=british]{english}
78− \setotherlanguage[variant=swiss]{german}
79− \setotherlanguage[]{spanish}
80− \setotherlanguage[]{french}
81\fi
82\fi
82\ifxetex
83\ifxetex
83− % load bidi as late as possible as it modifies e.g. graphicx
84+ % Load bidi as late as possible as it modifies e.g. graphicx
84 \usepackage{bidi}
85 \usepackage{bidi}
85\fi
86\fi
86\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
87\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex