-
Notifications
You must be signed in to change notification settings - Fork 5
/
cdr.cls
275 lines (227 loc) · 6.41 KB
/
cdr.cls
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
% -*- latex -*-
%
% Document class for Conceptual Design Report
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{cdr}[2015/02/02]
\LoadClass[12pt,letterpaper]{report}
\RequirePackage[letterpaper,margin=2cm]{geometry}
% Required values and their setters
\newcommand\thedoctitle{DRAFT Conceptual Design Report}
\newcommand\thedocsubtitle{Deep Underground Neutrino Experiment (DUNE) and Long-Baseline Neutrino Facility (LBNF)}
\def\titleextra{ }
% Provide finer-grained sectioning.
\newcounter{subsubsubsection}[subsubsection]
\def\subsubsubsectionmark#1{}
\def\thesubsubsubsection {\thesubsubsection
.\arabic{subsubsubsection}}
\def\subsubsubsection{\@startsection
{subsubsubsection}{4}{\z@} {-3.25ex plus -1
ex minus -.2ex}{1.5ex plus .2ex}{\bf\normalsize\sffamily}}
\def\l@subsubsubsection{\@dottedtocline{4}{4.8em}
{4.2em}}
% List of other packages required, add as needed.
% Some basic packages
\RequirePackage{color,soul}
\RequirePackage{graphicx}
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern}
% Anne adds parskip 5/7/15
\RequirePackage{parskip}
\setlength{\parskip}{\baselineskip}
% Smart end-of-macro spacing
\RequirePackage{xspace}
% Let's use units properly and consistently!
\RequirePackage[detect-all=true,group-digits=true,group-separator={,},binary-units=true]{siunitx}
% this option trips up some people (eg, tom junk): group-minimum-digits=4,
% Long table is long
\RequirePackage{longtable}
% For abbrev/acronym lists
\RequirePackage[intoc]{nomencl}
\makenomenclature % does this belong here or outside of the class?
\renewcommand{\nomname}{Acronyms, Abbreviations and Terms}
\setlength{\nomlabelwidth}{0.2\textwidth}
% Tighter control of floats.
\RequirePackage{placeins}
%% fixme: this needs to be controlled by "draft"
\RequirePackage[color]{showkeys}
\RequirePackage[pagewise]{lineno}
\RequirePackage[table,usenames,dvipsnames]{xcolor}
\RequirePackage{framed}
\RequirePackage{wrapfig}
\RequirePackage{tikz}
\RequirePackage[skins]{tcolorbox}
\usetikzlibrary{snakes}
\usetikzlibrary{matrix}
\usetikzlibrary{trees}
\usetikzlibrary{positioning,arrows}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{shadings}% needed by tcolorbox
% fixme's, must folow xcolor, tikz, ifthen
\RequirePackage{todonotes}
\RequirePackage{menukeys}
\setlength{\marginparwidth}{2cm}
% Fancier headers
\RequirePackage{fancyhdr}
\newcommand{\titlepagecornerblock}{}
\fancypagestyle{empty}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{titlepage}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[RO]{\titlepagecornerblock}
\fancyfoot[C]{\includegraphics[width=0.4\textwidth]{dunelogo_colorhoriz}}
}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[C]{\bfseries \thepage} % except the center
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{simple}{
\fancyhf{}
\fancyhead[RO,LE]{\textsf{\footnotesize \thechapter--\thepage}}
\fancyhead[LO,RE]{\textsf{\footnotesize \leftmark}}
\fancyfoot[CO,CE]{\textsf{\footnotesize \explong}}
}
% Fancier tables
\RequirePackage{booktabs}
% from http://tex.stackexchange.com/questions/4811/make-first-row-of-table-all-bold:
\newcolumntype{$}{>{\global\let\currentrowstyle\relax}}
%$
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
#1\ignorespaces
}
\newcolumntype{L}{%
>{\raggedright
\bfseries
\boldmath
}l}%
\definecolor{lightblue}{RGB}{212,236,244}
\newcommand{\rowtitlestyle}{
\rowcolor{lightblue}
\rowstyle{\bfseries \boldmath}
}
\newcommand{\colhline}{
\arrayrulecolor{gray}
\specialrule{0.5pt}{0pt}{1pt}
\arrayrulecolor{black}
}
\newcommand{\toprowrule}{
\arrayrulecolor{gray}
\specialrule{1.2pt}{0pt}{1pt}
\arrayrulecolor{black}
}
%%% originals come from booktabs
%%% maybe want to customize:
% \renewcommand{\toprule}{
% \arrayrulecolor{red}
% \specialrule{1.5pt}{2pt}{0pt}
% \arrayrulecolor{black}
% }
% \renewcommand{\midrule}{
% \arrayrulecolor{red}
% \specialrule{1pt}{1pt}{1pt}
% \arrayrulecolor{black}
% }
% \renewcommand{\bottomrule}{
% \arrayrulecolor{red}
% \specialrule{1.5pt}{0pt}{2pt}
% \arrayrulecolor{black}
% }
\newcommand{\cdrtablabel}{}% stores the label
\newcommand{\cdrtabcaption}{}% stores the caption
\newcommand{\cdrtabcaptionshort}{}% stores an optional short caption
\newenvironment{cdrtable}[4][]
{
\if\relax\detokenize{#1}\relax
\gdef\cdrtabcaptionshort{\relax}
\else
\gdef\cdrtabcaptionshort{#1}
\fi
\gdef\cdrtablabel{#3}
\gdef\cdrtabcaption{#4}
\begin{table}[hbtp]
\centering
\caption[\cdrtabcaptionshort]{\cdrtabcaption}
\begin{tabular}{#2}
\toprule
\rowtitlestyle
}
{
\bottomrule
\end{tabular}
\label{tab:\cdrtablabel}
\end{table}
}
\newcommand{\cdrfiglabel}{}% stores the label
\newcommand{\cdrfigcaption}{}% stores the caption
\newcommand{\cdrfigcaptionshort}{}% stores an optional short caption
\newenvironment{cdrfigure}[3][]
{
\if\relax\detokenize{#1}\relax
\gdef\cdrfigcaptionshort{\relax}
\else
\gdef\cdrfigcaptionshort{#1}
\fi
\gdef\cdrfiglabel{#2}
\gdef\cdrfigcaption{#3}
\begin{figure}[hbtp]
\centering
}
{
\caption[\cdrfigcaptionshort]{\cdrfigcaption}
\label{fig:\cdrfiglabel}
\end{figure}
}
%
% Provide an "editors note" environment
%
\definecolor{editornotecolor}{RGB}{255,255,153}
\newenvironment{editornote}
{
\begin{center}
\begin{tcolorbox}[width=0.9\textwidth,
colframe=editornotecolor!130,
colback=editornotecolor!20!white,
skin=enhanced]
}
{
\end{tcolorbox}
\end{center}
}
% Hyperref typically needs to come at the end of all \usepackages
\RequirePackage[pdftex,bookmarks]{hyperref}
% Use to import pdf files (Anne 4/28/15)
\RequirePackage{pdfpages}
% this seems overly tortured
\newif\iffinal
%\finalfalse
\DeclareOption{final}{
\finaltrue
}
\ProcessOptions\relax
\iffinal
\presetkeys{todonotes}{disable}{}
\newcommand{\hlfix}[2]{}
\newcommand{\fixme}[1]{}
\else
% "draft"
%Set default style for todonotes
\presetkeys{todonotes}{fancyline}{}
\newcommand{\hlfix}[2]{\texthl{#1}\todo{#2}}
\newcommand{\fixme}[1]{\todo[inline]{#1}}
\linenumbers
\fi
%add TOC, TOF, TOT, Ref to TOC (show up in PDF sidebar for easy navigation)
\RequirePackage{tocbibind}
% Use to include authorlist in PDF format
\usepackage{pdfpages}
%for \lesssim symbol
\usepackage{amsfonts}
\usepackage{amssymb}