git.iko.soy/typeable/pandoc
on master help sign in
LaTeX template: Group graphics-related code (#5389)

* LaTeX template: Group graphics-related code The default figure placement was added in <https://github.com/jgm/pandoc/commit/f3ab4bc2b99e9f7f3917708a9110d6500aa051a0>; there does not appear to have been a reason for placing it at the end of the preamble. * Update tests

commite91af0a8a32d68af4c533fdf4b7caaafade577ef authorAndrew Dunning <adunning@users.noreply.github.com> dateSat 23 Mar 2019, 00:35 (8 years ago) parent1e60776
5 files changed+18−35
data/templates/default.latex+6−7 test/lhs-test.latex+2−7 test/lhs-test.latex+lhs+2−7 test/writer.latex+6−7 test/writers-lang-and-dir.latex+2−7
data/templates/default.latex+6−7
@@ -1,5 +1,5 @@
11% Options for packages loaded elsewhere
2−\PassOptionsToPackage{unicode=true$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
2+\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
33\PassOptionsToPackage{hyphens}{url}
44$if(colorlinks)$
55\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
@@ -100,7 +100,7 @@ $endif$
100100 \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
101101 \usepackage[utf8]{inputenc}
102102 \usepackage{textcomp} % provides euro and other symbols
103−\else % if luatex or xelatex
103+\else % if luatex or xetex
104104$if(mathspec)$
105105 \ifxetex
106106 \usepackage{mathspec}
@@ -267,6 +267,10 @@ $if(graphics)$
267267% margins by default, and it is still possible to overwrite the defaults
268268% using explicit options in \includegraphics[width, height, ...]{}
269269\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
270+% Set default figure placement to htbp
271+\makeatletter
272+\def\fps@figure{htbp}
273+\makeatother
270274$endif$
271275$if(links-as-notes)$
272276% Make links footnotes instead of hotlinks:
@@ -304,11 +308,6 @@ $if(pagestyle)$
304308\pagestyle{$pagestyle$}
305309$endif$
306310
307−% Set default figure placement to htbp
308−\makeatletter
309−\def\fps@figure{htbp}
310−\makeatother
311−
312311$for(header-includes)$
313312$header-includes$
314313$endfor$
test/lhs-test.latex+2−7
@@ -1,5 +1,5 @@
11% Options for packages loaded elsewhere
2−\PassOptionsToPackage{unicode=true}{hyperref}
2+\PassOptionsToPackage{unicode}{hyperref}
33\PassOptionsToPackage{hyphens}{url}
44%
55\documentclass[
@@ -11,7 +11,7 @@
1111 \usepackage[T1]{fontenc}
1212 \usepackage[utf8]{inputenc}
1313 \usepackage{textcomp} % provides euro and other symbols
14−\else % if luatex or xelatex
14+\else % if luatex or xetex
1515 \usepackage{unicode-math}
1616 \defaultfontfeatures{Scale=MatchLowercase}
1717 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
@@ -91,11 +91,6 @@
9191 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
9292\fi
9393
94−% Set default figure placement to htbp
95−\makeatletter
96−\def\fps@figure{htbp}
97−\makeatother
98−
9994
10095\date{}
10196
test/lhs-test.latex+lhs+2−7
@@ -1,5 +1,5 @@
11% Options for packages loaded elsewhere
2−\PassOptionsToPackage{unicode=true}{hyperref}
2+\PassOptionsToPackage{unicode}{hyperref}
33\PassOptionsToPackage{hyphens}{url}
44%
55\documentclass[
@@ -11,7 +11,7 @@
1111 \usepackage[T1]{fontenc}
1212 \usepackage[utf8]{inputenc}
1313 \usepackage{textcomp} % provides euro and other symbols
14−\else % if luatex or xelatex
14+\else % if luatex or xetex
1515 \usepackage{unicode-math}
1616 \defaultfontfeatures{Scale=MatchLowercase}
1717 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
@@ -58,11 +58,6 @@
5858 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
5959\fi
6060
61−% Set default figure placement to htbp
62−\makeatletter
63−\def\fps@figure{htbp}
64−\makeatother
65−
6661
6762\date{}
6863
test/writer.latex+6−7
@@ -1,5 +1,5 @@
11% Options for packages loaded elsewhere
2−\PassOptionsToPackage{unicode=true}{hyperref}
2+\PassOptionsToPackage{unicode}{hyperref}
33\PassOptionsToPackage{hyphens}{url}
44%
55\documentclass[
@@ -11,7 +11,7 @@
1111 \usepackage[T1]{fontenc}
1212 \usepackage[utf8]{inputenc}
1313 \usepackage{textcomp} % provides euro and other symbols
14−\else % if luatex or xelatex
14+\else % if luatex or xetex
1515 \usepackage{unicode-math}
1616 \defaultfontfeatures{Scale=MatchLowercase}
1717 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
@@ -52,6 +52,10 @@
5252% margins by default, and it is still possible to overwrite the defaults
5353% using explicit options in \includegraphics[width, height, ...]{}
5454\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
55+% Set default figure placement to htbp
56+\makeatletter
57+\def\fps@figure{htbp}
58+\makeatother
5559\usepackage[normalem]{ulem}
5660% Avoid problems with \sout in headers with hyperref
5761\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
@@ -69,11 +73,6 @@
6973 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
7074\fi
7175
72−% Set default figure placement to htbp
73−\makeatletter
74−\def\fps@figure{htbp}
75−\makeatother
76−
7776
7877\title{Pandoc Test Suite}
7978\author{John MacFarlane \and Anonymous}
test/writers-lang-and-dir.latex+2−7
@@ -1,5 +1,5 @@
11% Options for packages loaded elsewhere
2−\PassOptionsToPackage{unicode=true}{hyperref}
2+\PassOptionsToPackage{unicode}{hyperref}
33\PassOptionsToPackage{hyphens}{url}
44%
55\documentclass[
@@ -12,7 +12,7 @@
1212 \usepackage[T1]{fontenc}
1313 \usepackage[utf8]{inputenc}
1414 \usepackage{textcomp} % provides euro and other symbols
15−\else % if luatex or xelatex
15+\else % if luatex or xetex
1616 \usepackage{unicode-math}
1717 \defaultfontfeatures{Scale=MatchLowercase}
1818 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
@@ -54,11 +54,6 @@
5454 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
5555\fi
5656
57−% Set default figure placement to htbp
58−\makeatletter
59−\def\fps@figure{htbp}
60−\makeatother
61−
6257\ifxetex
6358 % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
6459 \usepackage{polyglossia}