Page Layout ⇒ Heading Numbers overlap Heading Titles in ToC
Heading Numbers overlap Heading Titles in ToC
I am currently have some issue with the table of contents looking clinched (please see attachment).
Is this a common problem? It used to be that I just had to hit "PDFLaTeX" like four times and then hit "View PDF" and it would look fine, that trick is not working anymore.
Does anyone know what is the problem?
- Attachments
-
- ToC-overlapping.png (30.86 KiB) Viewed 14690 times
Reason: Image cut to the relevant content.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Heading Numbers overlap Heading Titles in ToC

I would suggest that you look at the package tocloft to fine tune the spacing issues.
Regards.
OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
Heading Numbers overlap Heading Titles in ToC
\usepackage
declarations? I would rather not post the whole TeX document on here.Heading Numbers overlap Heading Titles in ToC

In your case, it could have been a piece of code similar to this
Code: Select all
\documentclass{book}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\chapter{Introduction}
\lispum[1-2]
\chapter{Hadrons}
\lipsum[5-6]
\chapter{Leptons}
\lipsum[50-55]
\end{document}
OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
Heading Numbers overlap Heading Titles in ToC
Code: Select all
%\documentclass[12pt]{revtex4-1}
\documentclass[showpacs,preprintnumbers,amsmath,amssymb, nofootinbib]{revtex4-1}
%\usepackage{tocloft}
\usepackage{color}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{float}
\usepackage{url}
\usepackage{chngcntr}
\usepackage{hyperref}
\counterwithin{equation}{section}
\counterwithin{figure}{section}
\counterwithin{table}{section}
\usepackage{amsmath}
\usepackage{lineno}
\usepackage{etex}
\usepackage{bm}
%%%%%%%%%%%FEYNMAN STUFF
\usepackage{feynmp}
\DeclareGraphicsRule{.1}{mps}{.1}{}
%\usepackage{pst-pdf}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\hypersetup{colorlinks,
linkcolor=blue,
filecolor=black,
urlcolor=blue,
citecolor=black
}
\usepackage{varioref}
\usepackage{graphicx}
\newcommand{\dirac}[1]{\vert #1 \rangle}
\newcommand{\bra}[1]{\langle #1}
\newcommand{\vecbf}[1]{\vec{\textbf{#1}}}
\makeatletter
\def\endfmffile{%
\fmfcmd{\p@rcent\space the end.^^J%
end.^^J%
endinput;}%
\if@fmfio
\immediate\closeout\@outfmf
\fi
\ifnum\pdfshellescape=\@ne
\immediate\write18{mpost \thefmffile}%
\fi}
\makeatother
\begin{document}
\begin{center}
\chapter{{\Huge \textbf{CHEM 705 Section 1: Particle Physics}}}
\end{center}
\tableofcontents
\newpage
\addcontentsline{toc}{chapter}{Contents}
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\linenumbers
\section{Brief Review of Necessary Quantum Mechanics}
\subsection{Dirac Notation}
\subsection{Quantum Mechanical Vector Projections}
\subsubsection{Vector Addition}
\subsection{Heisenberg Uncertainty Principle}
\subsection{Feynman Diagrams}
\section{Leptons}
\section{The Gauge Bosons}
\subsubsection{Weak Bosonic Decays}
\section{Hadrons}
\subsection{Quarks}
\subsection{Mesons}
\subsubsection{Pion Decays}
\subsection{Baryons}
\subsubsection{Beta Decay}
\subsubsection{The $\Delta$ Particle}
\section{Heavier Quarks}
\subsection{Heavy Mesons}
\subsection{Strange Baryons}
\subsection{2nd Generation Strange Baryons}
\subsection{3rd Generation Strange Quarks}
\section{Reactions and Isospin}
\subsection{Isospin}
\section{Color Charge}
\subsection{Mesons...in Color}
\subsubsection{Gluons}
\section{Summary Problems}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Heading Numbers overlap Heading Titles in ToC

Code: Select all
\documentclass{revtex4-1}
\begin{document}
\tableofcontents
\listoffigures
\section{Brief Review of Necessary Quantum Mechanics}
\subsection{Dirac Notation}
\subsection{Quantum Mechanical Vector Projections}
\subsubsection{Vector Addition}
\subsection{Heisenberg Uncertainty Principle}
\subsection{Feynman Diagrams}
\end{document}
It's much easier to fix then. In this case, just insert this right after
\tableofcontents
:Code: Select all
\makeatletter
\let\toc@pre\relax
\let\toc@post\relax
\makeatother
The reason is, that RevTeX computes dimensions in the TOC lines(width of section numbers) but following lists of figures or tables change this calculation. The code above simply disables this faulty behavior.
Stefan
Re: Heading Numbers overlap Heading Titles in ToC
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Heading Numbers overlap Heading Titles in ToC

As you already showed more code, a few further tipps:
-
\usepackage{color}
can be removed since you loadxcolor
. - You don't need to load
amsmath
too, as RevTeX does it for you already. -
chngcntr
could be omitted if you use \numberwithin of amsmath, such as\numberwithin{equation}{section}
. - This chapter line doesn't match the meaning of LaTeX:
Better don't use font commands in heading commands, just the text. Instead, format your headings document-wide. It would be better structured and consistent, and note that the heading text may be used in the table of contents and in headers, which should not be huge for sure. Even if it's not visible here with RevTeX - just a general remark.
Code: Select all
\begin{center} \chapter{{\Huge \textbf{CHEM 705 Section 1: Particle Physics}}} \end{center}