使用自定义论文文档类对目录进行左对齐

使用自定义论文文档类对目录进行左对齐

我有一个恼人的问题,一直无法解决。我有一个来自大学的自定义文档类文件,我正在使用它来格式化我的论文。问题是目录中的对齐方式。对于超过一行的章节标题,对齐方式会切换到居中,我无法找到强制标题保持左对齐的方法。这是一张图片:

enter image description here

我已将类文件粘贴在下面。如果有人能告诉我如何编辑这个该死的文件以强制标题保持左对齐,我会非常高兴。我假设我应该编辑类文件,而不是构建文件,但我不确定。任何帮助都将不胜感激。这已经困扰我一段时间了……我的论文很快就要交了!:-P

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ucithesis}[2012/10/10 UCI Thesis class]
\LoadClassWithOptions{report}
\RequirePackage[hmargin={1in,1in},vmargin={1in,1in}]{geometry}
\RequirePackage{setspace}
\newcommand{\thesistitle}[1]{\newcommand\Thesistitle{#1}}
\newcommand{\degreename}[1]{\newcommand\Degreename{#1}}
\newcommand{\degreefield}[1]{\newcommand\Degreefield{#1}}
\newcommand{\authorname}[1]{\newcommand\Authorname{#1}}
\newcommand{\degreeyear}[1]{\newcommand\Degreeyear{#1}}
\newcommand{\committeechair}[1]{\newcommand\Committeechair{#1}}
\newcommand{\othercommitteemembers}[1] 
{\newcommand\Othercommitteemembers{#1}}
\newcommand{\copyrightdeclaration}[1]{\newcommand\Copyrightdeclaration{#1}}
\newcommand{\prepublishedcopyrightdeclaration}[1] 
{\newcommand\Prepublishedcopyrightdeclaration{#1}}
\newcommand{\dedications}[1]{\newcommand\Dedications{#1}}
\newcommand{\acknowledgments}[1]{\newcommand\Acknowledgments{#1}}
\newcommand{\curriculumvitae}[1]{\newcommand\Curriculumvitae{#1}}
\newcommand{\thesisabstract}[1]{\newcommand\Thesisbstract{#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
}
\newcommand{\copyrightpage}
{
\thispagestyle{empty}
\rule{0in}{0in}
\protect\vfill
\begin{center}
\Copyrightdeclaration
\end{center}
\clearpage
}
\newcommand{\prepublishedcopyrightpage}
{
\thispagestyle{empty}
\rule{0in}{0in}
\protect\vfill
\begin{center}
    \Prepublishedcopyrightdeclaration
\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}
\addtocontents{toc}{\protect\raggedleft Page\\}
\addtocontents{lof}{\protect\raggedleft Page\\}
\addtocontents{lot}{\protect\raggedleft Page\\}
\addtocontents{loa}{\protect\raggedleft Page\\}
\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}
    \ifx\Prepublishedcopyrightdeclaration\undefined
  \copyrightpage
\else
  \prepublishedcopyrightpage
    \fi
\setcounter{page}{2}
%\signaturepage  %% not for electronic submission
    \ifx\Dedications\undefined
\else
  \dedicationpage
\fi
\begin{flushright}
\tableofcontents
\end{flushright}

\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{LIST OF FIGURES}
\listoffigures
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{LIST OF TABLES}
\listoftables
\ifx\listalgorithmname\undefined  % for algorithm package
\else
  \clearpage
  \phantomsection
  \addcontentsline{toc}{chapter}{LIST OF ALGORITHMS}
  \listofalgorithms
\fi
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{ACKNOWLEDGMENTS}
\acknowledgmentspage
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{CURRICULUM VITAE}
\curriculumvitaepage
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{ABSTRACT OF THE DISSERTATION}
\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}
\addcontentsline{toc}{chapter}{Appendices}
}
\renewcommand{\bibliography}[1]{%
\if@filesw
\immediate\write\@auxout{\string\bibdata{#1}}%
\fi

\addcontentsline{toc}{chapter}{Bibliography}
\begin{singlespacing}
\@input@{\jobname.bbl}
\end{singlespacing}
}

答案1

(将此留给未来可能遇到同样问题的 UCI 毕业生。)

是的,这确实很烦人。我花了几个小时解决这个问题,并想出了以下解决办法。

这是由于chapter中定义的命令所致,该命令基于report.clslatex 文档类。只需删除一个命令 ( ) 即可解决对齐问题。我建议不要修改,而是使用。例如,可以将以下几行添加到 中:ucithesis.cls\advancereport.clsrenewcommanducithesis.cls

\renewcommand*\l@chapter[2]{%
 \ifnum \c@tocdepth >\m@ne
  \addpenalty{-\@highpenalty}%
  \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}

答案2

也许这就是它本来的样子。在更改任何内容之前,请与相应的大学人员/部门核实。

不要对类文件进行任何更改,将它们保留在论文本地,例如,

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

一个快速的解决方法是使用可选参数来避免目录中的长标题\chapter

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

相关内容