Page LayoutTOC entries spanning multiple lines

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
sbahn
Posts: 3
Joined: Thu May 06, 2010 1:15 pm

TOC entries spanning multiple lines

Post by sbahn »

Hi everybody,

I am in the process of writing my dissertation, but I have encountered a problem with the table of contents. The entry "The evolution of death rates and life expectancy in Denmark" is being printed on a single line, although the corresponding page number is printed outside the right margin. How can I fix this?

Thank you very much,
Esben

Code: Select all

\documentclass[11pt,b5paper]{book}
\usepackage{url}
\usepackage[danish,english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{latexsym}
\pagestyle{plain}
\usepackage{cite}
\usepackage{amssymb,amsmath,amsthm,epsfig,float,psfrag,amsfonts,harvard,rotating}
\usepackage{chapterbib}
\usepackage[dvips=false,pdftex=false,vtex=false]{geometry}
\usepackage[a4,center]{crop}
\usepackage{float}
\usepackage{array}
\usepackage{t1enc}
\usepackage{verbatim}
\usepackage{changebar}

\makeatletter
\renewcommand{\@makechapterhead}[1]{%
\vspace*{20 pt}%
{\setlength{\parindent}{0pt} \raggedright \normalfont
\bfseries\huge
\ifnum \value{secnumdepth}>1
   \if@mainmatter\thechapter.\ \fi%
\fi
#1\par\nobreak\vspace{15 pt}}}
\makeatother

...

\newpage
\thispagestyle{empty}
\frontmatter

\chapter{Preface}\input{Preface}
\chapter{Summary}\input{Summary}
\selectlanguage{danish}
\chapter{Sammenfatning}\input{Sammenfatning}
\selectlanguage{english}

\setcounter{tocdepth}{0} \tableofcontents

\mainmatter

\chapter{Introduction}\input{Introduction}

\chapter[{The evolution of death rates and life expectancy in Denmark}]{The evolution of death rates and life expectancy in Denmark}\label{chapter:evolution}\input{mortality}

\cleardoublepage \addcontentsline{toc}{chapter}{Bibliography}
\bibliography{afhandling}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

TOC entries spanning multiple lines

Post by localghost »

Your request in this form cannot be answered because of some deficiencies [1]. Follow the instructions in the linked topic unexceptionally. With a minimal example that reproduces the behaviour it will be much easier for others to offer specific help.

[1] View topic: Avoidable mistakes


Best regards and welcome to the board
Thorsten
sbahn
Posts: 3
Joined: Thu May 06, 2010 1:15 pm

TOC entries spanning multiple lines

Post by sbahn »

Thank you very much, Thorsten. Here is the example again, albeit much abbreviated. Below I link to the TOC as it appears with this code.

Best regards, and thank you very much,
Esben

Code: Select all

\documentclass[11pt,b5paper]{book}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,amsthm,epsfig,float,psfrag,amsfonts,harvard,rotating,latexsym}
\usepackage{atpbib}

\begin{document}
\setcounter{tocdepth}{0} \tableofcontents

\mainmatter

\chapter[Some solvable portfolio problems with quadratic and collective objectives]{Some solvable portfolio problems with quadratic and collective objectives}\label{chapter:Portfolio_selection}
\input{sspp(mathfin)}

\cleardoublepage \addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{atpbib}\bibliography{afhandling}
\end{document}
http://www.math.ku.dk/~ekj/latex/tableofcontents.jpg
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

TOC entries spanning multiple lines

Post by localghost »

This is very confusing. You now provide a second and rather different example from which you say that it also causes the misbehaviour. But the problem remains incomprehensible because you are doing partly the same and partly new mistakes. For better understanding I summarize.
  • The »atpbib« package is not listed on CTAN and you don't give a link where to find it (see the topic I linked above).
  • There is still an external file included which is not present to others (see the topic I linked above). Its contents is unknown but it is not very likely that it causes the problem thus is not relevant.
  • The example loads packages which certainly have nothing to do with the problem (see the topic I linked above).
  • The used bibliography database is missing and no sample database is provided (see the topic I linked above). But a bibliography is not relevant for the problem.
These points make the sample code not compilable thus insufficient. So, my efforts to help will end here for the moment. Perhaps somebody else is able to get involved with this. My last advice is to follow unexceptionally the instructions for a minimal example.
sbahn
Posts: 3
Joined: Thu May 06, 2010 1:15 pm

Re: TOC entries spanning multiple lines

Post by sbahn »

Thank you again for your effort, Thorsten.

In constructing the minimum example I discovered that the harvard package caused the problem.

Best,
Esben.
Post Reply