/
preamble.tex
140 lines (121 loc) · 3.85 KB
/
preamble.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
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry}
\usepackage{comment}
\usepackage{tabu}
\usepackage{xstring}
\usepackage{etoolbox}
\usepackage[backend=bibtex,defernumbers=true,sorting=ydnt,style=authoryear,doi=true,maxnames=99,url=true]{biblatex}
\usepackage{calc}
\usepackage{microtype}
\usepackage{hyphenat}
\usepackage{changepage}
\usepackage{multicol}
\usepackage{xspace}
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage[]{xcolor}
\usepackage{setspace}
\hypersetup{
colorlinks=true,
linkcolor=black,
citecolor=black,
urlcolor=black,
pdfauthor=author,
}
% Remove indent spacing
\setlength{\parindent}{0in}
% Define some filters for convenience
\defbibfilter{other}{
type=report or
type=thesis
}
\defbibfilter{invited}{
type=incollection and
keyword=invited
}
\defbibfilter{talk}{
type=incollection and
not keyword=invited
}
\addbibresource{ref.bib}
% Bold names of students
\newboolean{bold}
\newcommand{\makeauthorsbold}[1]{%
\DeclareNameFormat{author}{%
\setboolean{bold}{false}%
\renewcommand{\do}[1]{\expandafter\ifstrequal\expandafter{\namepartfamily}{####1}{\setboolean{bold}{true}}{}}%
\docsvlist{#1}%
\ifthenelse{\value{listcount}=1}
{%
{\expandafter\ifthenelse{\boolean{bold}}{\mkbibbold{\namepartfamily\addcomma\addspace \namepartgiveni}}{\namepartfamily\addcomma\addspace \namepartgiveni}}%
}{\ifnumless{\value{listcount}}{\value{liststop}}
{\expandafter\ifthenelse{\boolean{bold}}{\mkbibbold{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni}}{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni}}%
{\expandafter\ifthenelse{\boolean{bold}}{\mkbibbold{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni\addcomma\isdot}}{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni\addcomma\isdot}}%
}
\ifthenelse{\value{listcount}<\value{liststop}}
{\addcomma\space}{}
}
}
% Get reverse numbering for entries
\makeatletter
\patchcmd{\blx@printbibliography}
{\blx@bibliography\blx@tempa}
{\setcounter{bibitemtotal}{0}%
\begingroup
\def\do##1{\stepcounter{bibitemtotal}}%
\dolistloop{\blx@tempa}%
\endgroup
\blx@bibliography\blx@tempa}{}{}
\makeatother
\newcounter{bibitemtotal}
\newrobustcmd*{\mkbibdesc}[1]{%
\number\numexpr\value{bibitemtotal}+1-#1\relax}
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\defbibenvironment{bibliography}
{\list
{\printtext[labelnumberwidth]{\printfield{labelprefix}\printfield{labelnumber}}}
{}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
% Set spacing in itemize
\setlist{itemsep=3pt,topsep=3pt,parsep=0pt,partopsep=0pt}
% Set spacing around titles (syntax: spacing left, before, after)
\usepackage{titlesec}
\titlespacing*{\section}
{0pt}{6pt}{6pt}
\titlespacing*{\subsection}
{0pt}{6pt}{6pt}
% Header/footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\lhead{\today}
\chead{}
\rhead{}
\cfoot{}
\rfoot{\thepage}
\cfoot{}
\lfoot{}
% Table of contents
\usepackage{titletoc}
\setcounter{tocdepth}{2}
\renewcommand{\contentsname}{\Large Table of Contents}
% Use Gatech-required section number schemes
\renewcommand{\thesection}{\Roman{section}.}
\renewcommand{\thesubsection}{\Alph{subsection}.}
\renewcommand{\thesubsubsection}{\Alph{subsection}\arabic{subsubsection}.}
% Make TOC a bit nicer
\makeatletter
\renewcommand{\l@section}{\@dottedtocline{1}{1.5em}{2.4em}}
\renewcommand{\l@subsection}{\@dottedtocline{2}{3.0em}{2.4em}}
\renewcommand{\l@subsubsection}{\@dottedtocline{3}{7.4em}{4.5em}}
\makeatother
% Allow for an asterisk before a bib entry
\makeatletter
\providecommand{\bib@extsym}{}
\DeclareEntryOption[string]{extsym}{\renewcommand{\bib@extsym}{#1}}
\renewbibmacro*{begentry}{\printtext{\bib@extsym\xspace}}
\makeatother