I have an annoying issue that I have not been able to fix. I have a custom document class file from my university I'm using to format my thesis. The problem is the alignment in the table of contents. For chapter titles that go over a single line, the alignment switches to centered and I can't figure out a way to force the title to remain left justified. Here is a picture:

I have pasted the class file below. I would be so happy if someone could tell me how to edit this darn file to force the titles to remain left justified. I am assuming I should make an edit to the class file, rather than the build file, but I'm not sure. Any help would be MUCH appreciated. This has been bothering me for a while.. and my thesis is due soon! :-P

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ucithesis}[2012/10/10 UCI Thesis class]
\RequirePackage[hmargin={1in,1in},vmargin={1in,1in}]{geometry}
\RequirePackage{setspace}
\newcommand{\othercommitteemembers}[1]
{\newcommand\Othercommitteemembers{#1}}
\newcommand{\thesistitlepage}
{
\vspace*{0.5in}
\thispagestyle{empty}
\singlespacing
\begin{center}
UNIVERSITY OF CALIFORNIA, \\
IRVINE \\
\vspace{0.4in}
\Thesistitle \\
\vspace{0.15in}
DISSERTATION \\
\vspace{0.4in}
submitted in partial satisfaction of the requirements \\
for the degree of \\
\vspace{0.4in}
\MakeUppercase\Degreename \\
\vspace{0.15in}
in \Degreefield \\
\vspace{0.4in}
by \\
\vspace{0.4in}
\Authorname \\
\end{center}
\vspace{1in}
\begin{flushright}
Dissertation Committee: \\
\Committeechair, Chair \\
\Othercommitteemembers \\
\end{flushright}
\vfill
\begin{center}
\Degreeyear
\end{center}
\clearpage
}
{
\thispagestyle{empty}
\rule{0in}{0in}
\protect\vfill
\begin{center}
\end{center}
\clearpage
}
{
\thispagestyle{empty}
\rule{0in}{0in}
\protect\vfill
\begin{center}
\end{center}
\clearpage
}
\newcommand{\signaturepage}
{
\vspace*{1in}
\begin{center}
The dissertation of \Authorname \\
is approved and is acceptable in quality and form for \\
publication on microfilm and in digital formats: \\
\end{center}
\vspace{3in}
\begin{flushright}
\rule{3in}{0.01in} \\
\vspace{0.4in}
\rule{3in}{0.01in} \\
\vspace{0.4in}
\rule{3in}{0.01in} \\
Committee Chair
\end{flushright}
\vspace{.75in}
\begin{center}
University of California, Irvine \\
\Degreeyear
\end{center}
\clearpage
}
\newcommand{\dedicationpage}
{
\begin{center}
\textbf{\Large DEDICATION} \\
\vspace{0.4in}
\Dedications
\end{center}
\clearpage
}
\newcommand{\acknowledgmentspage}
{
\begin{center}
\textbf{\Large ACKNOWLEDGMENTS}
\end{center}
\parskip 12pt
\parindent 0pt
\Acknowledgments
\clearpage
}
\newcommand{\curriculumvitaepage}
{
\begin{center}
\textbf{\Large CURRICULUM VITAE} \\
\vspace{0.4in}
\textbf{\large{\Authorname}}
\end{center}
\Curriculumvitae
\clearpage
}
\newcommand{\abstractpage}
{
\begin{center}
{\bf\Large ABSTRACT OF THE DISSERTATION} \\
\vspace{0.2in}
\Thesistitle \\
\vspace{0.2in}
By \\
\vspace{0.2in}
\Authorname \\
\vspace{0.2in}
\Degreename\ in \Degreefield \\
\vspace{0.2in}
University of California, Irvine, \Degreeyear \\
\vspace{0.2in}
\Committeechair, Chair \\
\end{center}
\vspace{0.2in}
\doublespacing
\Thesisbstract
\clearpage
}
\renewcommand{\contentsname}{\protect\centering\protect\Large TABLE OF
CONTENTS}
\renewcommand{\listfigurename}{\protect\centering\protect\Large LIST OF
FIGURES}
\renewcommand{\listtablename}{\protect\centering\protect\Large LIST OF
TABLES}
\newcommand{\preliminarypages}
{
\pagenumbering{gobble}% Remove page numbers (and reset to 1), see
http://tex.stackexchange.com/questions/54333/no-page-numbering
\clearpage
\thispagestyle{empty}
\thesistitlepage
\clearpage
\pagenumbering{roman}
\else
\fi
\setcounter{page}{2}
%\signaturepage  %% not for electronic submission
\ifx\Dedications\undefined
\else
\dedicationpage
\fi
\begin{flushright}
\tableofcontents
\end{flushright}

\clearpage
\phantomsection
\listoffigures
\clearpage
\phantomsection
\listoftables
\ifx\listalgorithmname\undefined  % for algorithm package
\else
\clearpage
\phantomsection
\listofalgorithms
\fi
\clearpage
\phantomsection
\acknowledgmentspage
\clearpage
\phantomsection
\curriculumvitaepage
\clearpage
\phantomsection
\abstractpage
\clearpage
\setcounter{page}{1}
\pagenumbering{arabic}
}
\newcommand{\myappendix}
{
\par
\setcounter{section}{0}
\setcounter{figure}{0}
\setcounter{table}{0}
\setcounter{equation}{0}
\gdef\thechapter{\@Alph\c@section}
\gdef\thesection{\@Alph\c@section}
\chapter*{Appendices}
}
\renewcommand{\bibliography}[1]{%
\if@filesw
\immediate\write\@auxout{\string\bibdata{#1}}%
\fi

\begin{singlespacing}
\@input@{\jobname.bbl}
\end{singlespacing}
}


(Leaving this for future UCI grads who might experience a same issue.)

Yeah, it is indeed annoying. I spent a few hours on this, and came up with the following fix.

It is due to the chapter command defined in report.cls, the latex document class that ucithesis.cls is based on. Just removing one command (\advance) would fix the alignment problem. I recommend not to modify report.cls, but to use renewcommand. For example, the following lines can be added into ucithesis.cls:

\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
%%% \advance\leftskip\@tempdima  %%% <--- Lose (or comment out) this line
\leftskip\@tempdima              %%% <--- Add this line
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}

• All hail Sungduk! May 25 '18 at 1:01

Perhaps that is how it is meant to look. Before changing anything check with the appropriate University person/department.

Don't make any changes to the class file, keep them local to your thesis, e.g.,

\documentclass[...]{...}
local code changing class bits and pieces
\begin{document}


A quick fix is not to have long titles in the ToC by using the optional \chapter argument.

\chapter[Short title for ToC and Header]{Long title for the body}

• I appreciate your tip! I am quite sure this is not how it's supposed to look. I can bring up UCI theses from recent years with lots of long chapter names, and there they are, nicely aligned.. I've tried slotting in various commands in the build file, like \begin{flushleft} \tableofcontents \end{flushleft}, but I can't get the thing to do what I want! Apr 22 '18 at 0:55