-
Notifications
You must be signed in to change notification settings - Fork 0
/
common-latex.tex
153 lines (122 loc) · 4.48 KB
/
common-latex.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
\usepackage[T1]{fontenc}
% Specify the font.
\usepackage{fourier} % Adobe Utopia
\usepackage{microtype}
\microtypecontext{spacing=nonfrench}
% For better formatting in the table listing referees
\usepackage{array}
% Page margins.
\usepackage[margin=2cm]{geometry}
\setlength{\headheight}{15pt}
% Say "A", not "Chapter A", by removing the word \chapter.
\renewcommand{\chaptername}{}
% Candidate's notes
\newcommand*{\notefont}{\fontfamily{phv}\selectfont}
% To include images
\usepackage{graphicx}
% Tighter lists.
\usepackage{enumitem}
\setlist{noitemsep}
% For rules in tables
\usepackage{booktabs}
% For better formatting in the table listing referees
\usepackage{array}
% To allow H location for image floating (meaning "right here")
\usepackage{float}
% Figures float, but minipages don't, so these let me
% me put graphics where I want, labelled, with captions.
% \usepackage{wrapfig}
% \usepackage{caption}
% To include other PDFs. Section and page numbering are all handled perfectly.
\usepackage{pdfpages}
% When including slides do this to make a 2x3 layout:
% \includepdf[pages=-,nup=2x3,delta=5mm 5mm,landscape=false]{filename.pdf}
% I was getting errors like this:
% pdfTeX warning: pdflatex (file ./2-4-1-lrts-frbr-book-review.pdf): PDF inclusion: found PDF version <1.7>, but at most version <1.5> allowed
% but this fixes it:
\pdfoptionpdfminorversion=7
% Suppress warnings like this:
% pdfTeX warning: pdflatex (file ./pdfs/B 2.2.1 Introduction to Data Visualization for Research.pdf): PDF inclusion: multiple pdfs with page group included in a single page
\pdfsuppresswarningpagegroup=1
% For better table formatting
%\usepackage{multirow}
%\usepackage{rotating}
%\usepackage{longtable}
% Start numbering sections at 0. Because that's where numbering starts.
% \setcounter{section}{-1}
% \setcounter{chapter}{-1}
% Nice headers.
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
% \thepage, \thesubsection etc. \leftmark is chapter title, \rightmark is section title
% \renewcommand{\headrulewidth}{1pt}
\fancyhead[C]{\nouppercase{\rightmark}}
% \fancyfoot[L]{Name Here}
\fancyfoot[C]{\leftmark}
\fancyfoot[R]{\thepage}
\fancypagestyle{plain}{%
\fancyhf{}%
% \fancyfoot[L]{Name Here}
\fancyfoot[C]{\leftmark}
\fancyfoot[R]{\thepage}
}
\newcommand{\chaptertitle}{}
\renewcommand{\chaptermark}[1]{\renewcommand{\chaptertitle}{Chapter \thechapter\ #1}}
\renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{}}
\renewcommand{\subsectionmark}[1]{\markright{\thesubsection\ #1}}
% Colours red the line above the footer.
\renewcommand{\footrule}{\hbox to\headwidth{\color{red}\leaders\hrule height \headrulewidth\hfill}}
% Turn \url and \href into hyperlinks in PDFs, and pass hyphens option to url package
% (which hyperref calls) to get better line breaks.
% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url?rq=1
\PassOptionsToPackage{hyphens}{url}\usepackage[pdfborder={0 0 0},colorlinks=true,urlcolor=blue]{hyperref}
% With this I can say \link{https://example.com/} and it makes it a hyperlink wrapped in < >
\newcommand{\link}[1]{{\small $<$\url{#1}$>$}}
% Add PDF properties (part of hyperref)
\hypersetup{%
bookmarksnumbered, % To get A 1.2 etc. into the bookmarks
pdfauthor={File Preparation Committee},
pdfsubject={},
pdftitle={Letters of Reference},
pdfkeywords={},
linkcolor=black % Other TOC listings, and internal links, are in red
}
%% Attachments
% \attached puts a short horizontal rule, with some space above and below,
% which I'll follow with a list of the attachments for the section.
% This isn't used, but I'll leave it in just in case.
\newcommand{\attached}{%
\vspace{1em}
\noindent\rule{8cm}{0.4pt}
\newline
\vspace{1em} Attached:
}
%% Candidate's notes
% \candidatenote adds a note from the candidate, formatted (with a
% different typeface) so it looks noticeably different from the rest
% of the file. The phv font is a Helvetica clone.
\newcommand{\candidatenote}[1] {%
\par\noindent\rule{\textwidth}{1pt}
{\large Candidate's note:}
\begin{quote}
\fontfamily{phv}\selectfont
{\small #1}
\end{quote}
}
%% Committee notes
% \committeenote adds a note from the FPC, in italics.
\newcommand{\committeenote}[1] {%
\par\noindent\rule{\textwidth}{1pt}
{\large File Preparation Committee note:}
\begin{quote}
\itshape{}
{\small #1}
\end{quote}
}
% No paragraph indent.
% \setlength{\parindent}{0pt}
% \setlength{\parskip}{\baselineskip}
% Remove the page numbers from the TOC.
% \let\Contentsline\contentsline
% \renewcommand\contentsline[3]{\Contentsline{#1}{#2}{}}