| 1 |
% !TEX TS-program = xelatex |
| 2 |
% !TEX encoding = UTF-8 Unicode |
| 3 |
% -*- coding: UTF-8; -*- |
| 4 |
% vim: set fenc=utf-8 |
| 5 |
|
| 6 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7 |
%% simplethesisdissertation.cls |
| 8 |
%% <https://github.com/zachscrivena/simple-thesis-dissertation> |
| 9 |
%% This is free and unencumbered software released into the |
| 10 |
%% public domain; see <http://unlicense.org> for details. |
| 11 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12 |
|
| 13 |
\NeedsTeXFormat{LaTeX2e} |
| 14 |
|
| 15 |
\ProvidesClass{simplethesisdissertation}[2016/12/25 Simple Thesis Dissertation https://github.com/zachscrivena/simple-thesis-dissertation] |
| 16 |
|
| 17 |
\DeclareOption{a4paper}{\PassOptionsToClass{\CurrentOption}{report}} |
| 18 |
\DeclareOption{letterpaper}{\PassOptionsToClass{\CurrentOption}{report}} |
| 19 |
|
| 20 |
% Run in non-stop mode. |
| 21 |
\DeclareOption{nonstopmode}{\nonstopmode} |
| 22 |
|
| 23 |
% Draft mode. |
| 24 |
\newcommand{\TypesetInDraftMode}{0} |
| 25 |
\DeclareOption{draftmode}{\renewcommand{\TypesetInDraftMode}{1}} |
| 26 |
|
| 27 |
\ProcessOptions\relax |
| 28 |
|
| 29 |
% Use report class as the base class. |
| 30 |
\LoadClass[12pt,oneside]{report} |
| 31 |
|
| 32 |
% Geometry package for page margins. |
| 33 |
% A4-size (210 mm × 297 mm) single-sided pages |
| 34 |
\RequirePackage[ |
| 35 |
left=25.4mm, |
| 36 |
right=25.4mm, |
| 37 |
top=20mm, |
| 38 |
bottom=16mm, |
| 39 |
headsep=6mm, % header separation, above text body |
| 40 |
footskip=6mm] % footer skip, below text body |
| 41 |
{geometry} |
| 42 |
|
| 43 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 44 |
%% MISCELLANEOUS PACKAGES. |
| 45 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 46 |
|
| 47 |
%\RequirePackage[none]{hyphenat} % Disable hyphenation. |
| 48 |
\RequirePackage[english]{babel} % For language-specific hyphenation. |
| 49 |
\RequirePackage{cite} % Automatically sort and range citations numbers. |
| 50 |
\RequirePackage{environ} % For easy definition of environments. |
| 51 |
\RequirePackage{rotating} % For rotating objects. |
| 52 |
\RequirePackage{framed} % For framed text. |
| 53 |
|
| 54 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 55 |
%% PDF OUTPUT. |
| 56 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 57 |
|
| 58 |
% PDF settings and properties. |
| 59 |
\RequirePackage{hyperref} |
| 60 |
|
| 61 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 62 |
%% COLORS. |
| 63 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 64 |
|
| 65 |
\RequirePackage[usenames]{color} % For colors. |
| 66 |
\definecolor{AccentOne}{RGB}{0,68,186} % blue |
| 67 |
|
| 68 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 69 |
%% FONTS. |
| 70 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 71 |
|
| 72 |
\RequirePackage{fontspec} |
| 73 |
\defaultfontfeatures{Mapping=tex-text} % to support TeX conventions like "---". |
| 74 |
\RequirePackage{xunicode} % Unicode support for LaTeX character names (accents, European chars, etc.). |
| 75 |
\RequirePackage{xltxtra} % Extra customizations for XeLaTeX. |
| 76 |
\RequirePackage{lmodern} % For Latin Modern fonts. |
| 77 |
|
| 78 |
% Font: Main font, \textnormal{}, \normalfont. |
| 79 |
\setmainfont |
| 80 |
[Path=./Fonts/tinos/, |
| 81 |
ItalicFont=Tinos-Italic, |
| 82 |
BoldFont=Tinos-Bold, |
| 83 |
BoldItalicFont=Tinos-BoldItalic, |
| 84 |
Scale=1.00] |
| 85 |
{Tinos-Regular.ttf} |
| 86 |
|
| 87 |
% Font: Roman font, \textrm{}, \rmfamily. |
| 88 |
\setromanfont |
| 89 |
[Path=./Fonts/tinos/, |
| 90 |
ItalicFont=Tinos-Italic, |
| 91 |
BoldFont=Tinos-Bold, |
| 92 |
BoldItalicFont=Tinos-BoldItalic, |
| 93 |
Scale=1.00] |
| 94 |
{Tinos-Regular.ttf} |
| 95 |
|
| 96 |
% Font: Sans-serif font, \textsf{}, \sffamily. |
| 97 |
\setsansfont |
| 98 |
[Path=./Fonts/carlito/, |
| 99 |
ItalicFont=Carlito-Italic, |
| 100 |
BoldFont=Carlito-Bold, |
| 101 |
BoldItalicFont=Carlito-BoldItalic, |
| 102 |
Scale=0.95] |
| 103 |
{Carlito-Regular.ttf} |
| 104 |
|
| 105 |
% Font: Monospace font, \texttt{}, \ttfamily. |
| 106 |
\setmonofont |
| 107 |
[Path=./Fonts/mplus/, |
| 108 |
BoldFont=mplus-1m-bold, |
| 109 |
Scale=0.95] |
| 110 |
{mplus-1m-regular.ttf} |
| 111 |
|
| 112 |
% Symbols. |
| 113 |
\RequirePackage{textcomp} % For symbols. |
| 114 |
\RequirePackage{underscore} % Use underscore symbol without escape sequence. |
| 115 |
|
| 116 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 117 |
%% SECTION HEADINGS. |
| 118 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 119 |
|
| 120 |
% Section heading fonts. |
| 121 |
\RequirePackage[explicit]{titlesec} |
| 122 |
|
| 123 |
\titlespacing*{\part}% |
| 124 |
{0em}% left |
| 125 |
{8em}% vertical space before title |
| 126 |
{4em}% vertical space after title |
| 127 |
[0em]% right |
| 128 |
|
| 129 |
\titleformat{\part} |
| 130 |
[display]% shape |
| 131 |
{\sffamily\bfseries\filcenter}% applied to label and text |
| 132 |
{\fontsize{16}{19.2}\selectfont\color{AccentOne}PART~\thepart}% applied to the label only |
| 133 |
{1em}% vertical spacing between label and text |
| 134 |
{\fontsize{32}{38.4}\selectfont{#1}}% applied before the text |
| 135 |
[]% applied after the text |
| 136 |
|
| 137 |
\titleformat{name=\part,numberless} |
| 138 |
[display]% shape |
| 139 |
{\sffamily\bfseries\filcenter}% applied to label and text |
| 140 |
{\fontsize{16}{19.2}\selectfont\color{AccentOne}~}% applied to the label only |
| 141 |
{1em}% vertical spacing between label and text |
| 142 |
{\fontsize{32}{38.4}\selectfont{#1}}% applied before the text |
| 143 |
[]% applied after the text |
| 144 |
|
| 145 |
\titlespacing*{\chapter}% |
| 146 |
{0em}% left |
| 147 |
{5em}% vertical space before title |
| 148 |
{2em}% vertical space after title |
| 149 |
[0em]% right |
| 150 |
|
| 151 |
\titleformat{\chapter} |
| 152 |
[display]% shape |
| 153 |
{\sffamily\bfseries\raggedright}% applied to label and text |
| 154 |
{\fontsize{17.5}{21}\selectfont\color{AccentOne}CHAPTER~\thechapter}% applied to the label only |
| 155 |
{0em}% vertical spacing between label and text |
| 156 |
{\fontsize{30}{36}\selectfont{#1}}% applied before the text |
| 157 |
[]% applied after the text |
| 158 |
|
| 159 |
\titleformat{name=\chapter,numberless} |
| 160 |
[display]% shape |
| 161 |
{\sffamily\bfseries\raggedright}% applied to label and text |
| 162 |
{\fontsize{17.5}{21}\selectfont\color{AccentOne}~}% applied to the label only |
| 163 |
{0em}% vertical spacing between label and text |
| 164 |
{\fontsize{30}{36}\selectfont{#1}}% applied before the text |
| 165 |
[]% applied after the text |
| 166 |
|
| 167 |
\titleformat{\section}% |
| 168 |
[hang]% shape |
| 169 |
{\fontsize{17}{20.4}\selectfont\sffamily\bfseries\raggedright}% applied to label and text |
| 170 |
{\color{AccentOne}\thetitle}% applied to the label only |
| 171 |
{0.5em}% horizontal spacing between label and text |
| 172 |
{#1}% applied before the text |
| 173 |
[]% applied after the text |
| 174 |
|
| 175 |
\titleformat{\subsection}% |
| 176 |
[hang]% shape |
| 177 |
{\fontsize{14.5}{17.4}\selectfont\sffamily\bfseries\raggedright}% applied to label and text |
| 178 |
{\color{AccentOne}\thetitle}% applied to the label only |
| 179 |
{0.5em}% horizontal spacing between label and text |
| 180 |
{#1}% applied before the text |
| 181 |
[]% applied after the text |
| 182 |
|
| 183 |
\titleformat{\subsubsection}% |
| 184 |
[hang]% shape |
| 185 |
{\fontsize{13}{15.6}\selectfont\sffamily\bfseries\raggedright}% applied to label and text |
| 186 |
{\color{AccentOne}\thetitle}% applied to the label only |
| 187 |
{0.5em}% horizontal spacing between label and text |
| 188 |
{#1}% applied before the text |
| 189 |
[]% applied after the text |
| 190 |
|
| 191 |
\titlespacing*{\paragraph}% |
| 192 |
{\parindent}% left |
| 193 |
{\parskip}% vertical space before title |
| 194 |
{0.5em}% horizontal space after title |
| 195 |
[]% right |
| 196 |
|
| 197 |
\titleformat{\paragraph}% |
| 198 |
[runin]% shape |
| 199 |
{\sffamily\bfseries}% applied to label and text |
| 200 |
{}% applied to the label only |
| 201 |
{0em}% horizontal spacing between label and text |
| 202 |
{#1.}% applied before the text |
| 203 |
[]% applied after the text |
| 204 |
|
| 205 |
\titlespacing*{\subparagraph}% |
| 206 |
{2\parindent}% left |
| 207 |
{\parskip}% vertical space before title |
| 208 |
{0.5em}% horizontal space after title |
| 209 |
[]% right |
| 210 |
|
| 211 |
\titleformat{\subparagraph}% |
| 212 |
[runin]% shape |
| 213 |
{\sffamily\bfseries\itshape}% applied to label and text |
| 214 |
{}% applied to the label only |
| 215 |
{0em}% horizontal spacing between label and text |
| 216 |
{#1.}% applied before the text |
| 217 |
[]% applied after the text |
| 218 |
|
| 219 |
% Section numbering depth. |
| 220 |
\setcounter{secnumdepth}{10} |
| 221 |
|
| 222 |
% Macros to capture section names. |
| 223 |
\def\Chaptername{} |
| 224 |
\let\Chaptermark\chaptermark |
| 225 |
\def\chaptermark#1{\def\Chaptername{#1}\Chaptermark{#1}} |
| 226 |
\def\Sectionname{} |
| 227 |
\let\Sectionmark\sectionmark |
| 228 |
\def\sectionmark#1{\def\Sectionname{#1}\Sectionmark{#1}} |
| 229 |
\def\Subsectionname{} |
| 230 |
\let\Subsectionmark\subsectionmark |
| 231 |
\def\subsectionmark#1{\def\Subsectionname{#1}\Subsectionmark{#1}} |
| 232 |
\def\Subsubsectionname{} |
| 233 |
\let\Subsubsectionmark\subsubsectionmark |
| 234 |
\def\subsubsectionmark#1{\def\Subsubsectionname{#1}\Subsubsectionmark{#1}} |
| 235 |
|
| 236 |
% References to parts. |
| 237 |
\newcommand{\Part}{{\color{AccentOne}Part}} |
| 238 |
\newcommand{\Parts}{{\color{AccentOne}Parts}} |
| 239 |
\newcommand{\pref}[1]{{\color{AccentOne}\ref{#1}}} |
| 240 |
|
| 241 |
% References to chapters. |
| 242 |
\newcommand{\Chapter}{{\color{AccentOne}Chapter}} |
| 243 |
\newcommand{\Chapters}{{\color{AccentOne}Chapters}} |
| 244 |
\newcommand{\cref}[1]{{\color{AccentOne}\ref{#1}}} |
| 245 |
|
| 246 |
% References to sections. |
| 247 |
\newcommand{\Section}{{\color{AccentOne}Section}} |
| 248 |
\newcommand{\Sections}{{\color{AccentOne}Sections}} |
| 249 |
\newcommand{\sref}[1]{{\color{AccentOne}\ref{#1}}} |
| 250 |
|
| 251 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 252 |
%% PARAGRAPHS. |
| 253 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 254 |
|
| 255 |
% Line spacing. |
| 256 |
\RequirePackage{setspace} |
| 257 |
%\singlespacing |
| 258 |
\onehalfspacing |
| 259 |
%\doublespacing |
| 260 |
%\setstretch{1.40} % custom |
| 261 |
|
| 262 |
% Paragraph indentation: |
| 263 |
% Indent first line of all paragraphs (including the first), |
| 264 |
% as in IEEE style. |
| 265 |
\let\@afterindentfalse\@afterindenttrue |
| 266 |
|
| 267 |
% Indented blocks. |
| 268 |
\newcommand{\IndentBlock}[1]{\noindent\hangafter=0\hangindent=#1\parindent\ignorespaces} |
| 269 |
\newcommand{\IndentHanging}{\noindent\hangafter=1\hangindent=\parindent\ignorespaces} |
| 270 |
|
| 271 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 272 |
%% HEADERS AND FOOTERS. |
| 273 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 274 |
|
| 275 |
% Header and footer font. |
| 276 |
\newcommand{\UseHeaderFooterFont}{\footnotesize\sffamily} |
| 277 |
|
| 278 |
% Footer. |
| 279 |
\ifnum\TypesetInDraftMode=0 |
| 280 |
\newcommand{\FooterText}{} |
| 281 |
\else |
| 282 |
\newcommand{\FooterText}{\null\hfill\color{red}{DRAFT}~\Timestamp\hfill\null} |
| 283 |
\fi |
| 284 |
|
| 285 |
% Empty style, for title page. |
| 286 |
\def\ps@empty{% |
| 287 |
\def\@oddhead{\UseHeaderFooterFont}% |
| 288 |
\def\@evenhead{\UseHeaderFooterFont}% |
| 289 |
\def\@oddfoot{\UseHeaderFooterFont\FooterText}% |
| 290 |
\def\@evenfoot{\UseHeaderFooterFont\FooterText}} |
| 291 |
|
| 292 |
% Plain style, for chapter pages. |
| 293 |
\def\ps@plain{% |
| 294 |
\def\@oddhead{\UseHeaderFooterFont% |
| 295 |
\hfill\thepage\hfill}% |
| 296 |
\def\@evenhead{\UseHeaderFooterFont% |
| 297 |
\hfill\thepage\hfill}% |
| 298 |
\def\@oddfoot{\UseHeaderFooterFont\FooterText}% |
| 299 |
\def\@evenfoot{\UseHeaderFooterFont\FooterText}} |
| 300 |
|
| 301 |
\iffalse |
| 302 |
% Plain style, for chapter pages. |
| 303 |
\def\ps@plain{% |
| 304 |
\def\@oddhead{\UseHeaderFooterFont% |
| 305 |
\MakeUppercase{\DocumentTitle}\hfill\thepage}% |
| 306 |
\def\@evenhead{\UseHeaderFooterFont% |
| 307 |
\thepage\hfill\MakeUppercase{\DocumentTitle}}% |
| 308 |
\def\@oddfoot{\UseHeaderFooterFont\FooterText}% |
| 309 |
\def\@evenfoot{\UseHeaderFooterFont\FooterText}} |
| 310 |
|
| 311 |
% Regular style, for regular pages in numbered chapters. |
| 312 |
\def\ps@regular{% |
| 313 |
\def\@oddhead{\UseHeaderFooterFont% |
| 314 |
\MakeUppercase{\chaptername~\thechapter~~\Chaptername}\hfill\thepage}% |
| 315 |
\def\@evenhead{\UseHeaderFooterFont% |
| 316 |
\thepage\hfill\MakeUppercase{\DocumentTitle}}% |
| 317 |
\def\@oddfoot{\UseHeaderFooterFont\FooterText}% |
| 318 |
\def\@evenfoot{\UseHeaderFooterFont\FooterText}} |
| 319 |
|
| 320 |
% Regular style, for regular pages in unnumbered chapters. |
| 321 |
\def\ps@regularunnumberedchapters{% |
| 322 |
\def\@oddhead{\UseHeaderFooterFont% |
| 323 |
\MakeUppercase{\Chaptername}\hfill\thepage}% |
| 324 |
\def\@evenhead{\UseHeaderFooterFont% |
| 325 |
\thepage\hfill\MakeUppercase{\DocumentTitle}}% |
| 326 |
\def\@oddfoot{\UseHeaderFooterFont\FooterText}% |
| 327 |
\def\@evenfoot{\UseHeaderFooterFont\FooterText}} |
| 328 |
\fi |
| 329 |
|
| 330 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 331 |
%% FOOTNOTES. |
| 332 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 333 |
|
| 334 |
% Blank footnotes. |
| 335 |
\newcommand\BlankFootnote[1]{% |
| 336 |
\begingroup% |
| 337 |
\renewcommand{\thefootnote}{}% |
| 338 |
\footnotetext{#1}% |
| 339 |
\addtocounter{footnote}{-1}% |
| 340 |
\addtocounter{Hfootnote}{-1}% |
| 341 |
\endgroup} |
| 342 |
|
| 343 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 344 |
%% LISTS. |
| 345 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 346 |
|
| 347 |
% Numbered lists in IEEE style. |
| 348 |
% (Individual lists can be modified by redefining |
| 349 |
% these macros inside the enumerate environment.) |
| 350 |
|
| 351 |
% 1st level: 1), 2), 3) |
| 352 |
\renewcommand{\theenumi}{\arabic{enumi}} |
| 353 |
\renewcommand{\labelenumi}{\theenumi)} |
| 354 |
% 2nd level: a), b), c) |
| 355 |
\renewcommand{\theenumii}{\alph{enumii}} |
| 356 |
\renewcommand{\labelenumii}{\theenumii)} |
| 357 |
\renewcommand\p@enumii{} |
| 358 |
% 3rd level: i), ii), iii) |
| 359 |
\renewcommand{\theenumiii}{\roman{enumiii}} |
| 360 |
\renewcommand{\labelenumiii}{\theenumiii)} |
| 361 |
\renewcommand\p@enumiii{} |
| 362 |
% 4th level: A), B), C) |
| 363 |
\renewcommand{\theenumiv}{\Alph{enumiv}} |
| 364 |
\renewcommand{\labelenumiv}{\theenumiv)} |
| 365 |
\renewcommand\p@enumiv{} |
| 366 |
|
| 367 |
% Numbered lists: Adjust spacing. |
| 368 |
\let\oldenumerate\enumerate |
| 369 |
\renewcommand{\enumerate}{ |
| 370 |
\oldenumerate |
| 371 |
\setlength{\itemsep}{0pt} |
| 372 |
\setlength{\parskip}{0pt} |
| 373 |
\setlength{\parsep}{0pt} |
| 374 |
} |
| 375 |
|
| 376 |
% Itemized lists: Adjust spacing. |
| 377 |
\let\olditemize\itemize |
| 378 |
\renewcommand{\itemize}{ |
| 379 |
\olditemize |
| 380 |
\setlength{\itemsep}{0pt} |
| 381 |
\setlength{\parskip}{0pt} |
| 382 |
\setlength{\parsep}{0pt} |
| 383 |
} |
| 384 |
|
| 385 |
% Definition items. |
| 386 |
\newcommand{\DefineItem}[1]{% |
| 387 |
\IndentBlock{1}#1\nopagebreak |
| 388 |
\par\IndentBlock{2}} |
| 389 |
|
| 390 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 391 |
%% FIGURES AND TABLES. |
| 392 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 393 |
|
| 394 |
\RequirePackage{graphicx} % To support graphics in EPS format. |
| 395 |
\RequirePackage{longtable} % For multi-page long tables. |
| 396 |
\RequirePackage{multirow} % To support multi-row cells in tables. |
| 397 |
\RequirePackage{booktabs} % For making nice tables. |
| 398 |
\RequirePackage{array} % For better table content alignment. |
| 399 |
|
| 400 |
% Adjust spacing between table rows. |
| 401 |
\renewcommand*\arraystretch{1.25} |
| 402 |
|
| 403 |
% Dashed lines in tables. |
| 404 |
\RequirePackage{arydshln} |
| 405 |
\def\dashvertical{;{2pt/3pt}} |
| 406 |
\def\dashhorizontal{\hdashline[2pt/3pt]} |
| 407 |
|
| 408 |
% Captions for figures and tables. |
| 409 |
\newcommand{\CaptionFontSize}{\small} |
| 410 |
|
| 411 |
\def\@figurestring{figure} |
| 412 |
\def\@tablestring{table} |
| 413 |
\def\@makecaption#1#2{% |
| 414 |
\CaptionFontSize |
| 415 |
\ifx\@captype\@figurestring |
| 416 |
\vskip1em |
| 417 |
\fi |
| 418 |
\sbox\@tempboxa{{\color{AccentOne}\sffamily\bfseries\MakeUppercase{#1}}\hspace{0.5em}#2}% |
| 419 |
\ifdim\wd\@tempboxa>\hsize |
| 420 |
{{\color{AccentOne}\sffamily\bfseries\MakeUppercase{#1}}\hspace{0.5em}#2}% |
| 421 |
\else |
| 422 |
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% |
| 423 |
\fi |
| 424 |
\ifx\@captype\@tablestring |
| 425 |
\vskip1em |
| 426 |
\fi |
| 427 |
} |
| 428 |
|
| 429 |
% References to figures. |
| 430 |
\newcommand{\Figure}{{\color{AccentOne}Figure}} |
| 431 |
\newcommand{\Figures}{{\color{AccentOne}Figures}} |
| 432 |
\newcommand{\fref}[1]{{\color{AccentOne}\ref{#1}}} |
| 433 |
|
| 434 |
% References to tables. |
| 435 |
\newcommand{\Table}{{\color{AccentOne}Table}} |
| 436 |
\newcommand{\Tables}{{\color{AccentOne}Tables}} |
| 437 |
\newcommand{\tref}[1]{{\color{AccentOne}\ref{#1}}} |
| 438 |
|
| 439 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 440 |
%% DATE AND TIME. |
| 441 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 442 |
|
| 443 |
\RequirePackage{datetime2} % For dates and times. |
| 444 |
|
| 445 |
% Timestamp. |
| 446 |
\newcommand{\Timestamp}{{\DTMnow}} |
| 447 |
|
| 448 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 449 |
%% MATHEMATICS. |
| 450 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 451 |
|
| 452 |
\RequirePackage{amsmath,amsfonts,amsbsy,amssymb,amsthm} % AMS packages. |
| 453 |
|
| 454 |
% Indicator function "1[.]" symbol. |
| 455 |
% Option 1: Use "\mathbf" |
| 456 |
%\newcommand{\one}[1]{{\mathbf{1}\left[#1\right]}} |
| 457 |
% Option 2: Use "bbold" package (install "bbold-type1" first) |
| 458 |
\DeclareSymbolFont{bbold}{U}{bbold}{m}{n} |
| 459 |
\DeclareSymbolFontAlphabet{\mathbbold}{bbold} |
| 460 |
\newcommand{\one}[1]{{\mathbbold{1}\left[#1\right]}} |
| 461 |
% Option 3: Use "dsfont" package |
| 462 |
%\RequirePackage{dsfont} |
| 463 |
%\newcommand{\one}[1]{{\mathds{1}\left[#1\right]}} |
| 464 |
|
| 465 |
% Allow line breaks within math blocks. |
| 466 |
\allowdisplaybreaks |
| 467 |
|
| 468 |
% Prevent line breaks within math expressions. |
| 469 |
\relpenalty=10000 |
| 470 |
\binoppenalty=10000 |
| 471 |
\sloppy |
| 472 |
|
| 473 |
% Theorems (cf. "amsthm.sty"). |
| 474 |
\newtheoremstyle{MyPlain}% |
| 475 |
{0.4em}% space above |
| 476 |
{0.4em}% space below |
| 477 |
{\itshape}% body font |
| 478 |
{}% indent amount |
| 479 |
{}% theorem head font |
| 480 |
{}% punctuation after theorem head |
| 481 |
{0.5em}% space after theorem head |
| 482 |
{\sffamily\bfseries{\color{AccentOne}\MakeUppercase{\thmname{#1}\thmnumber{ #2}}}\thmnote{ (#3)}}% custom theorem head spec |
| 483 |
|
| 484 |
\newtheoremstyle{MyDefinition}% |
| 485 |
{0.4em}% space above |
| 486 |
{0.4em}% space below |
| 487 |
{}% body font |
| 488 |
{}% indent amount |
| 489 |
{}% theorem head font |
| 490 |
{}% punctuation after theorem head |
| 491 |
{0.5em}% space after theorem head |
| 492 |
{\sffamily\bfseries{\color{AccentOne}\MakeUppercase{\thmname{#1}\thmnumber{ #2}}}\thmnote{ (#3)}}% custom theorem head spec |
| 493 |
|
| 494 |
\theoremstyle{MyPlain} |
| 495 |
|
| 496 |
\@ifundefined{chapter} |
| 497 |
{\newtheorem{Thm:Theorem}{Theorem}[]} |
| 498 |
{\newtheorem{Thm:Theorem}{Theorem}[chapter]} |
| 499 |
|
| 500 |
\newtheorem{Thm:Lemma}[Thm:Theorem]{Lemma} |
| 501 |
\newtheorem{Thm:Corollary}[Thm:Theorem]{Corollary} |
| 502 |
\newtheorem{Thm:Claim}[Thm:Theorem]{Claim} |
| 503 |
\newtheorem{Thm:Proposition}[Thm:Theorem]{Proposition} |
| 504 |
\newtheorem{Thm:Conjecture}[Thm:Theorem]{Conjecture} |
| 505 |
|
| 506 |
\theoremstyle{MyDefinition} |
| 507 |
\newtheorem{Thm:Problem}[Thm:Theorem]{Problem} |
| 508 |
\newtheorem{Thm:Definition}[Thm:Theorem]{Definition} |
| 509 |
\newtheorem{Thm:Example}[Thm:Theorem]{Example} |
| 510 |
|
| 511 |
% References to theorems, lemmas, corollaries, etc. |
| 512 |
\newcommand{\Theorem}{{\color{AccentOne}Theorem}} |
| 513 |
\newcommand{\Theorems}{{\color{AccentOne}Theorems}} |
| 514 |
\newcommand{\Lemma}{{\color{AccentOne}Lemma}} |
| 515 |
\newcommand{\Lemmas}{{\color{AccentOne}Lemmas}} |
| 516 |
\newcommand{\Corollary}{{\color{AccentOne}Corollary}} |
| 517 |
\newcommand{\Corollaries}{{\color{AccentOne}Corollaries}} |
| 518 |
\newcommand{\Claim}{{\color{AccentOne}Claim}} |
| 519 |
\newcommand{\Claims}{{\color{AccentOne}Claims}} |
| 520 |
\newcommand{\Proposition}{{\color{AccentOne}Proposition}} |
| 521 |
\newcommand{\Propositions}{{\color{AccentOne}Propositions}} |
| 522 |
\newcommand{\Conjecture}{{\color{AccentOne}Conjecture}} |
| 523 |
\newcommand{\Conjectures}{{\color{AccentOne}Conjectures}} |
| 524 |
\newcommand{\Problem}{{\color{AccentOne}Problem}} |
| 525 |
\newcommand{\Problems}{{\color{AccentOne}Problems}} |
| 526 |
\newcommand{\Definition}{{\color{AccentOne}Definition}} |
| 527 |
\newcommand{\Definitions}{{\color{AccentOne}Definitions}} |
| 528 |
\newcommand{\Example}{{\color{AccentOne}Example}} |
| 529 |
\newcommand{\Examples}{{\color{AccentOne}Examples}} |
| 530 |
\newcommand{\mref}[1]{{\color{AccentOne}\ref{#1}}} |
| 531 |
|
| 532 |
% References to equations. |
| 533 |
%\let\origeqref=\eqref |
| 534 |
%\def\eqref#1{{\color{AccentOne}\origeqref{#1}}} |
| 535 |
|
| 536 |
% Proof. |
| 537 |
\renewenvironment{proof}[1][\proofname]{% |
| 538 |
{\par\vskip0.4em\noindent% |
| 539 |
\sffamily\bfseries\itshape{#1:}% |
| 540 |
\hspace{0.5em}}}% |
| 541 |
{\nopagebreak\hspace*{\fill}~\mbox{\rule[0pt]{1.3ex}{1.3ex}}\par} |
| 542 |
|
| 543 |
\newcommand{\qedmarker}{\nopagebreak\hspace*{\fill}~% |
| 544 |
\mbox{\rule[0pt]{1.3ex}{1.3ex}}\par} |
| 545 |
|
| 546 |
% Resized "align" environment. |
| 547 |
\NewEnviron{ResizedAlign}[2]{% |
| 548 |
\par\noindent |
| 549 |
\resizebox{#1}{!}{ |
| 550 |
\parbox{#2}{ |
| 551 |
\begin{align} |
| 552 |
\BODY |
| 553 |
\end{align}}}\par} |
| 554 |
|
| 555 |
% Resized "align*" environment. |
| 556 |
\NewEnviron{ResizedAlign*}[2]{% |
| 557 |
\par\noindent |
| 558 |
\resizebox{#1}{!}{ |
| 559 |
\parbox{#2}{ |
| 560 |
\begin{align*} |
| 561 |
\BODY |
| 562 |
\end{align*}}}\par} |
| 563 |
|
| 564 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 565 |
%% CODE. |
| 566 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 567 |
|
| 568 |
\RequirePackage{algpseudocode} % For algorithms. |
| 569 |
|
| 570 |
\algnewcommand{\CommentLeft}[1]{\State $\triangleright$\;\textit{#1}} |
| 571 |
\algnewcommand{\CommentRight}[1]{\null\hfill $\triangleright$\;\textit{#1}} |
| 572 |
\algnewcommand{\Goto}{\State \textbf{goto}\,} |
| 573 |
\algnewcommand{\Break}{\State \textbf{break}\,} |
| 574 |
\algnewcommand{\Stateu}{\Statex \hskip\ALG@thistlm} |
| 575 |
|
| 576 |
% Inline code. |
| 577 |
\newcommand{\code}[1]{\mbox{\color{DarkBlue}\texttt{#1}}} |
| 578 |
|
| 579 |
% Code block. |
| 580 |
\NewEnviron{CodeBlock}[1]{% |
| 581 |
\par\noindent\ignorespaces% |
| 582 |
\begin{oframed}% |
| 583 |
\noindent\;\textbf{#1} |
| 584 |
\nopagebreak\vspace{4pt}% |
| 585 |
\hrule width \textwidth height 0.6pt depth 0pt |
| 586 |
\vspace{4pt}% |
| 587 |
\begin{algorithmic}[1] |
| 588 |
\BODY |
| 589 |
\ignorespaces% |
| 590 |
\end{algorithmic}% |
| 591 |
\end{oframed}% |
| 592 |
\par} |
| 593 |
|
| 594 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 595 |
%% TABLE OF CONTENTS (TOC) SETTINGS. |
| 596 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 597 |
|
| 598 |
% TOC depth. |
| 599 |
\setcounter{tocdepth}{10} |
| 600 |
|
| 601 |
% Suppress entries in the TOC. |
| 602 |
\newcommand{\DummyThree}[3]{} |
| 603 |
|
| 604 |
\newcommand{\DisableTOCUpdates}{% |
| 605 |
\let\tempaddcontentsline=\addcontentsline |
| 606 |
\let\addcontentsline=\DummyThree} |
| 607 |
|
| 608 |
\newcommand{\EnableTOCUpdates}{% |
| 609 |
\let\addcontentsline=\tempaddcontentsline} |
| 610 |
|
| 611 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 612 |
%% HIDDEN TEXT, TODO MARKER, SAMPLE/BLIND TEXT. |
| 613 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 614 |
|
| 615 |
% Hidden text. |
| 616 |
\newcommand{\Hide}[1]{} |
| 617 |
|
| 618 |
% TODO marker. |
| 619 |
\ifnum\TypesetInDraftMode=0 |
| 620 |
\newcommand{\TODO}[1]{} |
| 621 |
\else |
| 622 |
\newcommand{\TODO}[1]{{\color{red}\fbox{\texttt{\textbf{TODO}}}~#1}\PackageWarning{TODO:}{#1}} |
| 623 |
\fi |
| 624 |
|
| 625 |
% Sample/blind text. |
| 626 |
\RequirePackage{lipsum} |
| 627 |
|
| 628 |
\ifnum\TypesetInDraftMode=0 |
| 629 |
\renewcommand{\lipsum}[1][]{} |
| 630 |
\fi |
| 631 |
|
| 632 |
% End of class file. |
| 633 |
\endinput |