Commit ce21c1ad authored by Johnson, Seth R.'s avatar Johnson, Seth R.
Browse files

Fix table of contents

parent 16556a1c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -74,9 +74,9 @@
\frontmatter

\tableofcontents
% LIST OF FIGURES
% LIST OF FIGURES: optional if fewer than 5 are used
\listoffigures
% LIST OF TABLES
% LIST OF TABLES: optional if fewer than 5 are used
\listoftables
% LIST OF ACRONYMS
% NOTE: this will only print if `makeindex X.ist -o X.gls X.glo` is executed.
+50 −79
Original line number Diff line number Diff line
@@ -41,13 +41,19 @@
\RequirePackage{color} % colored fonts and boxes
\RequirePackage{wallpaper} % background on cover page
\RequirePackage{fancyhdr} % headers and footers

% Manage paragraph indentation, but revert changes to @starttoc so that tocloft
% allows us to define cfttocprehook etc.
\let\@starttoc@latex@orig\@starttoc
\RequirePackage[parfill]{parskip} % No indent for paragraphs
\let\@starttoc\@starttoc@latex@orig

\RequirePackage{emptypage} % hide footers on blank pages
\RequirePackage[font=bf]{caption}
%\RequirePackage{tocloft} % table of contents styling
\RequirePackage{titlesec} % title modification: use text size
\RequirePackage[pdfusetitle]{hyperref} % url and links in PDF
\RequirePackage{emptypage} % create a blank page with no numbers
\RequirePackage{tocloft} % table of contents styling


% Footer for cover page
@@ -90,49 +96,49 @@
\titleformat{\paragraph}{\bf}{\thetitle}{1ex}{}[]
\titleformat{\subparagraph}{\bf\itshape}{\relax}{0pt}{}[]

% Names ToC title and centers is with hfill. Pushes normalsize.
%\renewcommand{\contentsname}{\hfill\bfseries\normalsize\uppercase{Contents}\hfill}
%\renewcommand{\cftaftertoctitle}{\hfill}

% Names index title and centers is with hfill. Pushes normalsize.
%\renewcommand{\indexname}{\hfill\bfseries\normalsize\uppercase{Index}\hfill}
%\renewcommand{\cftaftertoctitle}{\hfill}

% Names  of figures title and centers is with hfill. Pushes normalsize.
% \renewcommand{\listfigurename}{\bfseries\normalsize\uppercase{List of Figures}}
%\renewcommand{\cftaftertoctitle}{\hfill}

% Names list of tables title and centers is with hfill. Pushes normalsize.
%\renewcommand{\listtablename}{\hfill\bfseries\normalsize\uppercase{List of Tables}\hfill}
%\renewcommand{\cftaftertoctitle}{\hfill}
%% TABLE OF CONTENTS, FIGURES, TABLES %%

% TOC styles
% 
% % Removes vertical space between sections in TOC.
% \setlength{\cftbeforesecskip}{0pt}
% 
% % Add leaders to all sections and subsections in the TOC.
% \renewcommand\cftsecleader{\cftdotfill{\cftdotsep}}
% 
% % Sections use UPPERCASE in ToC
% \xpatchcmd{\l@section}{#1}{\uppercase {#1}}{}{}
% 
% % Subsections use UPPERCASE in ToC
% \xpatchcmd{\l@subsection}{#1}{\uppercase{#1}}{}{}
% 
%\renewcommand{\cfttoctitlefont}{\hfill~~~~~~~~~~\large\bfseries\MakeUppercase}
%\renewcommand{\cftaftertoctitle}{\hfill\null}
% Make the contents, figure, and table titles uppercase
\renewcommand\cfttoctitlefont{\bfseries\MakeUppercase}
\renewcommand\cftloftitlefont{\bfseries\MakeUppercase}
\renewcommand\cftlottitlefont{\bfseries\MakeUppercase}
% Squish section lines together
\setlength{\cftbeforesecskip}{0pt}
% Add leaders to all sections and subsections in the TOC.
\renewcommand\cftsecleader{\cftdotfill{\cftdotsep}}

%\renewcommand{\cftloftitlefont}{\hfill~~~~~~~~~~\large\bfseries\MakeUppercase}
%\renewcommand{\cftafterloftitle}{\hfill\null}
% Clear the page before TOC if it is in the ``front matter''
\AtBeginDocument{%
\let\@origcfttoc\tableofcontents
\renewcommand{\tableofcontents}{%
\@cleariffrontmatter
\@origcfttoc%
}
}

%\renewcommand{\cftlottitlefont}{\hfill\large\bfseries\MakeUppercase}
%\renewcommand{\cftafterloftitle}{\hfill\null}
% Contents/figures should have plain numbering if in the front matter
\renewcommand\@cfttocstart{%
  \if@mainmatter%
    \relax%
  \else%
    \pagestyle{plain}%
  \fi%
}
\renewcommand\@cfttocfinish{%
  \if@mainmatter%
    \relax%
  \else%
    \clearpage%
  \fi%
}

% \renewcommand{\cftsecfont}{\normalfont}
% \renewcommand{\cftsubsecfont}{\normalfont}
% \renewcommand{\cftsecpagefont}{\normalfont}
% \renewcommand\@tocrmarg{.5in plus .5fil}
% Add section titles for figures/tables
\renewcommand\cftlofprehook{%
\phantomsection\addcontentsline{toc}{section}{List of Figures}%
}
\renewcommand\cftlotprehook{%
\phantomsection\addcontentsline{toc}{section}{List of Tables}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% VARIABLES
@@ -385,41 +391,6 @@ under contract DE-AC05-00OR22725
\@mainmattertrue
\def\@cleariffrontmatter{\if@mainmatter\relax\else{\cleardoublepage}\fi}

\newcommand\ornltableofcontents{
  \@cleariffrontmatter%
  \pagestyle{plain}%
  \tableofcontents%
}

\let\@oldlistoffigures=\listoffigures
\renewcommand\listoffigures{
  \@cleariffrontmatter%
	\addcontentsline{toc}{section}{List of Figures}
	\phantomsection
  \@oldlistoffigures%
}

\let\@oldlistoftables=\listoftables
\def\listoftables{
	\@cleariffrontmatter%
  % \addcontentsline{toc}{section}{List of Tables}
	%	\section*{List of Figures}%
  \@oldlistoftables%
}
 
\AtBeginDocument{%
  % Add the cover, OSTI, and title pages to the beginning of the document.
  \pagenumbering{none}
  % Begin actual document
  \raggedright
  \pagenumbering{arabic}
  \setcounter{page}{1}
  % Set up table formatting if used (must come after user's preamble)
  \def\TPTtagStyle#1{\slshape#1}%
  \let\@oldTPTnoteSettings=\TPTnoteSettings%
  \def\TPTnoteSettings{\@oldTPTnoteSettings\small}%
}

\newcommand{\frontmatter}{%
  \@mainmatterfalse%
  \def\and{\\}