4

I'm trying to format my thesis, and I copied the formatting stuff from a friend who finished her thesis last year. Unfortunately, she only had two chapters and then subsections. I have more chapters, and since they are roman numerals, the numbers are running into my titles. This is formatted (to the best of my knowledge) correctly, but I'd like to start the title text a little more to the right:

\documentclass[12pt,fleqn, letterpaper]{report}
\usepackage{indentfirst}
\usepackage{setspace}
\usepackage{titlesec}
\usepackage[hidelinks]{hyperref}

\oddsidemargin 0in
\textwidth 6.5 in

\topmargin 0in
\headheight 0in
\headsep 0in
\textheight 8.6in
\footskip 0.4in

\makeatletter
\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
       \hskip -\leftskip
      #1\nobreak\normalfont\leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
        mu$}\hfill\nobreak\hb@xt@\@pnumwidth{\hss #2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}
\makeatother

\titleformat{\chapter}
  {\normalfont \center}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{-.5 in}{0.35in}
\renewcommand{\thechapter}{\Roman{chapter}}

\renewcommand*\contentsname{TABLE OF CONTENTS}

 \begin{document}

\begin{singlespace}
\tableofcontents
\end{singlespace}

\addtocontents{toc}{\noindent CHAPTER\par}

\chapter{this is chapter I}
\chapter{this is chapter II}
\chapter{this is chapter III}
\chapter{this is chapter IV}
\chapter{this is chapter V}
\chapter{this is chapter VI}
\chapter{this is chapter VII}
\chapter{this is chapter VIII}

\end{document}
lockstep
  • 250,273
Minirogue
  • 639

2 Answers2

4

The width of the numerals for the chapters are governed by \@tempdima. You've set it at 1.5em, showing up as

enter image description here

Increase this to 2.5em and the output changes to:

enter image description here

Adjust it to your liking.

Werner
  • 603,163
  • Thank you. As I said, I copied the formatting from a friend, and I had no idea what any of that actually meant (just that it was good enough for the college of graduate studies) – Minirogue Jun 13 '13 at 03:50
1

Rather than manipulate low-level LaTeX commands to achieve some formatting-related objectives, you may find it easier -- especially in the long run -- to load one or more LaTeX packages and modify some of these packages' user commands to meet your specific objectives. In particular, you may want to become familiar with the tocloft and geometry packages.

The following MWE takes your code as its starting point and employs the geometry and tocloft packages to streamline the preamble. Incidentally, since you're using a "normal" (rather than bold) font weight for the header line ("Table of Contents") and the subheader line ("Chapter") of the ToC, I would recommend using a normal font weight for the chapter entries as well.

enter image description here

\documentclass[12pt,fleqn,letterpaper]{report}
\usepackage{indentfirst}
\usepackage{setspace}

\usepackage{titlesec}
   \titleformat{\chapter}
      {\normalfont \center}{\thechapter}{1em}{}
   \titlespacing*{\chapter}{0pt}{-.5 in}{0.35in}
   \renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand*\contentsname{TABLE OF CONTENTS}

\usepackage[margin=1in]{geometry}

\usepackage{tocloft}
   \renewcommand\cfttoctitlefont{\normalsize\normalfont}
   \renewcommand\cftbeforetoctitleskip{0pt}
   \renewcommand\cftaftertoctitleskip{2\baselineskip}
   \setlength\cftchapnumwidth{3em}
   \renewcommand\cftchapleader{\cftdotfill{\cftdotsep}}
   \renewcommand\cftchapfont{\normalfont}
   \renewcommand\cftchappagefont{\normalfont}

% It's good practice to load the hyperref package 
% late in the preamble
\usepackage[hidelinks]{hyperref}

\begin{document}
\begin{singlespace}
\tableofcontents
\end{singlespace}

\addtocontents{toc}{\noindent CHAPTER\par}

\chapter{This is chapter I}
\chapter{This is chapter II}
\chapter{This is chapter III}
\chapter{This is chapter IV}
\chapter{This is chapter V}
\chapter{This is chapter VI}
\chapter{This is chapter VII}
\chapter{This is chapter VIII}

\end{document}
Mico
  • 506,678