Skip to content

Commit ef23908

Browse files
committed
Porting template to more recent version of pandoc.
1 parent 06759f7 commit ef23908

File tree

5 files changed

+87
-82
lines changed

5 files changed

+87
-82
lines changed

md_version/makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ PANDOC_OPTIONS = --listings \
2020
--include-in-header templates/head_b.tex \
2121
--include-in-header templates/head_c.tex \
2222
--metadata-file=templates/info.md
23-
2423

2524
main.pdf : main.md
2625
pandoc $< $(PANDOC_OPTIONS) -o $@

md_version/templates/head_b.tex

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,14 @@
126126
% Meta-data %
127127
%%%%%%%%%%%%%
128128

129-
\hypersetup{
130-
pdftitle={\yourtitle},
131-
pdfauthor={\yourname},
132-
pdflang={en},
133-
pdfkeywords={\yourkeywords},
134-
pdfauthor={\yourname}
129+
\AtEndPreamble{
130+
\hypersetup{
131+
pdftitle={\yourtitle},
132+
pdfauthor={\yourname},
133+
pdflang={en},
134+
pdfkeywords={\yourkeywords},
135+
pdfauthor={\yourname}
136+
}
135137
}
136138

137139

md_version/templates/head_c.tex

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,29 +96,24 @@
9696
\makeatother
9797

9898
% Setup new colors
99-
\hypersetup{
100-
linkcolor=augustagrey,
101-
citecolor=augustagrey,
102-
filecolor=augustablue,
103-
urlcolor=augustablue,
104-
menucolor=augustagrey,
105-
runcolor=augustablue,
106-
linkbordercolor=augustagrey,
107-
citebordercolor=augustagrey,
108-
filebordercolor=augustablue,
109-
urlbordercolor=augustablue,
110-
menubordercolor=augustagrey,
111-
runbordercolor=augustablue,
112-
footnotecolor=augustagrey,
99+
\AtEndPreamble{
100+
\hypersetup{
101+
linkcolor=augustagrey,
102+
citecolor=augustagrey,
103+
filecolor=augustablue,
104+
urlcolor=augustablue,
105+
menucolor=augustagrey,
106+
runcolor=augustablue,
107+
linkbordercolor=augustagrey,
108+
citebordercolor=augustagrey,
109+
filebordercolor=augustablue,
110+
urlbordercolor=augustablue,
111+
menubordercolor=augustagrey,
112+
runbordercolor=augustablue,
113+
footnotecolor=augustagrey,
114+
}
113115
}
114116

115-
\makeatletter
116-
\Hy@AtBeginDocument{%
117-
\def\@pdfborder{0 0 0} % Overrides border definition set with colorlinks=true
118-
\def\@pdfborderstyle{/S/U/W 1} % Overrides border style set with colorlinks=true
119-
% Hyperlink border style will be underline of width 1pt
120-
}
121-
\makeatother
122117

123118

124119
% For sideways figures and landscape pages.

md_version/templates/info.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ classoption:
33
- oneside
44
- BCOR = 0 pt
55
- singlespacing = true
6-
mainfont: texgyretermes
6+
mainfont: TeXGyreTermes
77
mainfontoptions:
88
- Path=fonts/
99
- Extension=.otf

tex_version/main.tex

Lines changed: 62 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
% !TeX program = xelatex
2+
% !BIB program = bibtex
13
% Options for packages loaded elsewhere
24
\PassOptionsToPackage{unicode}{hyperref}
35
\PassOptionsToPackage{hyphens}{url}
@@ -9,16 +11,19 @@
911
BCOR = 0 pt,
1012
singlespacing = true]{scrbook}
1113
\usepackage{amsmath,amssymb}
12-
\usepackage{lmodern}
13-
\usepackage{iftex}
14+
\usepackage{iftex}h
1415
\ifPDFTeX
1516
\usepackage[T1]{fontenc}
1617
\usepackage[utf8]{inputenc}
1718
\usepackage{textcomp} % provide euro and other symbols
1819
\else % if luatex or xetex
19-
\usepackage{unicode-math}
20+
\usepackage{unicode-math} % this also loads fontspec
2021
\defaultfontfeatures{Scale=MatchLowercase}
2122
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
23+
\fi
24+
\usepackage{lmodern}
25+
\ifPDFTeX\else
26+
% xetex/luatex font selection
2227
\setmainfont[Path=fonts/,Extension=.otf,UprightFont=*-regular,BoldFont=*-bold,ItalicFont=*-italic,BoldItalicFont=*-BoldItalic]{texgyretermes}
2328
\fi
2429
% Use upquote if available, for straight quotes in verbatim environments
@@ -38,13 +43,6 @@
3843
\KOMAoptions{parskip=half}}
3944
\makeatother
4045
\usepackage{xcolor}
41-
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
42-
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
43-
\hypersetup{
44-
pdflang={en},
45-
hidelinks,
46-
pdfcreator={LaTeX via pandoc}}
47-
\urlstyle{same} % disable monospaced font for URLs
4846
\usepackage[top=1in, left=1.5in, right=1in, bottom=1in, truedimen,
4947
twoside=false, bindingoffset=0pt, nohead]{geometry}
5048
\usepackage{listings}
@@ -84,6 +82,10 @@
8482
\usepackage[bidi=default]{babel}
8583
\fi
8684
\babelprovide[main,import]{english}
85+
\ifPDFTeX
86+
\else
87+
\babelfont[english]{rm}{texgyretermes}
88+
\fi
8789
% get rid of language-specific shorthands (see #6817):
8890
\let\LanguageShortHands\languageshorthands
8991
\def\languageshorthands#1{}
@@ -257,12 +259,14 @@
257259
% Meta-data %
258260
%%%%%%%%%%%%%
259261

260-
\hypersetup{
261-
pdftitle={\yourtitle},
262-
pdfauthor={\yourname},
263-
pdflang={en},
264-
pdfkeywords={\yourkeywords},
265-
pdfauthor={\yourname}
262+
\AtEndPreamble{
263+
\hypersetup{
264+
pdftitle={\yourtitle},
265+
pdfauthor={\yourname},
266+
pdflang={en},
267+
pdfkeywords={\yourkeywords},
268+
pdfauthor={\yourname}
269+
}
266270
}
267271

268272

@@ -498,29 +502,24 @@
498502
\makeatother
499503

500504
% Setup new colors
501-
\hypersetup{
502-
linkcolor=augustagrey,
503-
citecolor=augustagrey,
504-
filecolor=augustablue,
505-
urlcolor=augustablue,
506-
menucolor=augustagrey,
507-
runcolor=augustablue,
508-
linkbordercolor=augustagrey,
509-
citebordercolor=augustagrey,
510-
filebordercolor=augustablue,
511-
urlbordercolor=augustablue,
512-
menubordercolor=augustagrey,
513-
runbordercolor=augustablue,
514-
footnotecolor=augustagrey,
505+
\AtEndPreamble{
506+
\hypersetup{
507+
linkcolor=augustagrey,
508+
citecolor=augustagrey,
509+
filecolor=augustablue,
510+
urlcolor=augustablue,
511+
menucolor=augustagrey,
512+
runcolor=augustablue,
513+
linkbordercolor=augustagrey,
514+
citebordercolor=augustagrey,
515+
filebordercolor=augustablue,
516+
urlbordercolor=augustablue,
517+
menubordercolor=augustagrey,
518+
runbordercolor=augustablue,
519+
footnotecolor=augustagrey,
520+
}
515521
}
516522

517-
\makeatletter
518-
\Hy@AtBeginDocument{%
519-
\def\@pdfborder{0 0 0} % Overrides border definition set with colorlinks=true
520-
\def\@pdfborderstyle{/S/U/W 1} % Overrides border style set with colorlinks=true
521-
% Hyperlink border style will be underline of width 1pt
522-
}
523-
\makeatother
524523

525524

526525
% For sideways figures and landscape pages.
@@ -709,6 +708,13 @@
709708
\fi
710709
\usepackage[backend=biber]{biblatex}
711710
\addbibresource{./references/references.bib}
711+
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
712+
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
713+
\urlstyle{same}
714+
\hypersetup{
715+
pdflang={en},
716+
hidelinks,
717+
pdfcreator={LaTeX via pandoc}}
712718

713719
\title{\yourtitle}
714720
\usepackage{etoolbox}
@@ -1015,46 +1021,48 @@ \section{Tables}\label{tables}}
10151021
>{\centering\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.1667}}
10161022
>{\raggedleft\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.1667}}@{}}
10171023
\caption{The price of categories \label{tbl:demo1}}\tabularnewline
1018-
\toprule
1024+
\toprule\noalign{}
10191025
\begin{minipage}[b]{\linewidth}\raggedright
10201026
Column A
10211027
\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
10221028
Column B
10231029
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedleft
10241030
Column C
10251031
\end{minipage} \\
1026-
\midrule
1032+
\midrule\noalign{}
10271033
\endfirsthead
1028-
\toprule
1034+
\toprule\noalign{}
10291035
\begin{minipage}[b]{\linewidth}\raggedright
10301036
Column A
10311037
\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
10321038
Column B
10331039
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedleft
10341040
Column C
10351041
\end{minipage} \\
1036-
\midrule
1042+
\midrule\noalign{}
10371043
\endhead
1044+
\bottomrule\noalign{}
1045+
\endlastfoot
10381046
Category 1 High & High 95.00 & 100.00 \\
10391047
Category 2 High & High 82.50 & 80.50 \\
1040-
\bottomrule
10411048
\end{longtable}
10421049

10431050
\begin{longtable}[]{@{}llcr@{}}
10441051
\caption{Illustrating how to align entries in a table
10451052
\label{tbl:demo2}}\tabularnewline
1046-
\toprule
1053+
\toprule\noalign{}
10471054
Default & Left & Center & Right \\
1048-
\midrule
1055+
\midrule\noalign{}
10491056
\endfirsthead
1050-
\toprule
1057+
\toprule\noalign{}
10511058
Default & Left & Center & Right \\
1052-
\midrule
1059+
\midrule\noalign{}
10531060
\endhead
1061+
\bottomrule\noalign{}
1062+
\endlastfoot
10541063
High & Cat 1 & A & 100.00 \\
10551064
High & Cat 2 & B & 85.50 \\
10561065
Low & Cat 3 & C & 80.00 \\
1057-
\bottomrule
10581066
\end{longtable}
10591067

10601068
\begin{longtable}[]{@{}
@@ -1063,26 +1071,28 @@ \section{Tables}\label{tables}}
10631071
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.2917}}@{}}
10641072
\caption{The price and advantages of fruits
10651073
\label{tbl:demo3}}\tabularnewline
1066-
\toprule
1074+
\toprule\noalign{}
10671075
\begin{minipage}[b]{\linewidth}\raggedright
10681076
Fruit
10691077
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
10701078
Price
10711079
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
10721080
Advantages
10731081
\end{minipage} \\
1074-
\midrule
1082+
\midrule\noalign{}
10751083
\endfirsthead
1076-
\toprule
1084+
\toprule\noalign{}
10771085
\begin{minipage}[b]{\linewidth}\raggedright
10781086
Fruit
10791087
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
10801088
Price
10811089
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
10821090
Advantages
10831091
\end{minipage} \\
1084-
\midrule
1092+
\midrule\noalign{}
10851093
\endhead
1094+
\bottomrule\noalign{}
1095+
\endlastfoot
10861096
Bananas & \$1.34 & \begin{minipage}[t]{\linewidth}\raggedright
10871097
\begin{itemize}
10881098
\tightlist
@@ -1101,7 +1111,6 @@ \section{Tables}\label{tables}}
11011111
tasty
11021112
\end{itemize}
11031113
\end{minipage} \\
1104-
\bottomrule
11051114
\end{longtable}
11061115

11071116
\hypertarget{code-listings}{%
@@ -1205,7 +1214,7 @@ \section{Fonts}\label{fonts}}
12051214
when needed to the appropriate size (particularly in the cover page,
12061215
where most attributes need to be set at 16pts).
12071216

1208-
The ``usual'' correspondance between points and \LaTeX commands is as
1217+
The ``usual'' correspondence between points and \LaTeX commands is as
12091218
follows:
12101219

12111220
\getfontsize

0 commit comments

Comments
 (0)