Quick fix:
Redefine \contentsname
\renewcommand{\contentsname}{TABLE OF CONTENTS}
and apply a patch to \@makeschapterhead
locally only for the ToC, that means, when you have to issue \tableofcontents
, write the lines:
{\makeatletter
\patchcmd{\@makeschapterhead}
{\raggedright}
{\centering}
{}
{}
\tableofcontents
\makeatother}
MWE:
\documentclass{ucthesis}
\usepackage{etoolbox}
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\begin{document}
{\makeatletter
\patchcmd{\@makeschapterhead}
{\raggedright}
{\centering}
{}
{}
\tableofcontents
\makeatother}
\listoffigures
\listoftables
\chapter{Test}
\section{A section}
\end{document}
Output:
I changed the names of the files and the structure slightly, for sake of easyness to provide a solution.
The standard macro \addcontentsline
is responsible for the generation of ToC entries. If something should not be added to the ToC, but numbered anyway, it's better to kick out the meaning of \addcontentsline
for while inside mydocument.tex
. This is most easily done with a \begingroup...\endgroup
pair right after \subsection{MyDocument}
.
Any redefinition of a command or length changes, counter formatting is only done with such a group and does not affect the outside code.
Please have a look on the ToC, that \section{Another appendix}
behaves as usual whereas the Minidocument
subsection has its own counter formatting,but is numbered by default, without hard-coding.
Remark
If a book
or report
class is used, \appendix
behaves best with \chapter
subdivisions, not with \sections
as top level structure units.
main.tex -- the main document frame
\documentclass{book}
\begin{document}
\tableofcontents
%\include{chapters/chapter1}
%\include{chapters/chapter2}
\chapter{chapter1}
\chapter{chapter2}
\appendix
\renewcommand{\thesection}{\Alph{section}}
\input{appendixcontent}
\end{document}
appendixcontent.tex
\section{Appendix}
\InputIfFileExists{one}{}{}%
\InputIfFileExists{mydocument}{}{}%
\InputIfFileExists{another}{}%
\section{Another appendix}%
mydocument.tex
\setcounter{secnumdepth}{5}
\begingroup
\subsection{My Document}
\renewcommand{\thesubsubsection}{\arabic{subsubsection}}
\renewcommand{\addcontentsline}[3]{}% Do nothing
\subsubsection{abc}
\paragraph{hello}
\paragraph{world}
\subparagraph{world 1}
\subparagraph{world 2}
\subsubsection{xyz}
\endgroup
ToC without using the structure of the faked mini document
Structure of faked document
Best Answer
The default setting of page numbers in the table of contents is a precise choice of the ClassicThesis style, based on Bringhurst's book “The Elements of Typographic Style”.
The idea is that one doesn't need to sum up page numbers, so they don't need to be aligned.
You can get right aligned page numbers by passing the
dottedtoc
option toclassicthesis
:If I compile the manual of ArsClassica with this change, I get
to be compared with the default rendering