Skip to content

Instantly share code, notes, and snippets.

View edwardtoday's full-sized avatar

Pei Qing 卿培 edwardtoday

View GitHub Profile
\newcommand{\minsize}{\fontsize{10pt}{12pt}\selectfont}
\usepackage[top=1in, left=1.8in, bottom=1.4in, right=1.1in]{geometry}
\usepackage{shadowtext}
\shadowoffsetx{1pt}
\shadowoffsety{.7pt}
\usepackage{titlesec}
\makeatletter
\renewcommand{\@makechapterhead}[1]{
\vspace*{-6pt}
{\setlength{\parindent}{0pt}\raggedright
\normalfont \chaptersize
\shadowtext{\chaptertitlename\ \thechapter \quad\ #1}
\newcommand{\chaptersize}{\fontsize{22pt}{28pt}\selectfont\bfseries}
% change fontsize for section/subsection/subsubsection headings
\titleformat{\section}{\normalfont\sectionsize}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\subsectionsize}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\normalfont\subsubsectionsize}{\thesubsection}{1em}{}
% Change spacing for headings. Please ignore the actual numbers.
% They are tweaked by comparing PDF outputs to the Word template. --!
\titlespacing*{\section}{0pt}{-12pt}{6pt}
\titlespacing*{\subsection}{0pt}{-14pt}{6pt}
\titlespacing*{\subsubsection}{0pt}{-16pt}{6pt}
\renewcommand*{\bibname}{References}
\makeatletter
\renewenvironment{thebibliography}[1]{
\clearpage
\ifdefined\phantomsection
\phantomsection
\else
\fi
\addcontentsline{toc}{chapter}{\bibname}
\vspace*{-12pt}
\usepackage{appendix}
\makeatletter
\newcommand\appendix@chapter[1]{
\refstepcounter{chapter}
\orig@chapter*{
\vspace*{-72pt}
\subsectionsize\bfseries Appendix \@Alph\c@chapter: #1
\vspace*{-36pt}
}
\addcontentsline{toc}{chapter}{Appendix \@Alph\c@chapter: #1}
%%% Set Table of Contents format
\renewcommand\contentsname{Table of Contents}
\usepackage[subfigure]{tocloft}
\renewcommand{\cftbeforechapskip}{0pt}
\renewcommand{\cftbeforetoctitleskip}{6pt}
\renewcommand{\cftaftertoctitleskip}{12pt}
% Set ToC heading size the same as that of Abstract
\renewcommand\cfttoctitlefont{\subsectionsize\bfseries}
\renewcommand\cftchapfont{\tocchapsize\bfseries}
\renewcommand\cftchappresnum{Chapter } % prefix "Chapter " to chapters in ToC
\ifdefined\printmode
\usepackage{minted}
\usemintedstyle{bw} % turn off code highlighting
\else
% Online copy
\usepackage{minted}
\usemintedstyle{tango} % turn on code highlighting
% \newcommand{\printmode}{}