General ⇒ Long lines do not wrap around in Table of contents
Re: Long lines do not wrap around in Table of contents
yes actually! the content line just doesn't wrap and keeps going. If it's of any help i use Miktex 2.7
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10340
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Long lines do not wrap around in Table of contents
We get different results with the same code, seems like there's a problem with your LaTeX installation. Could you post your logfile of this code example above as attachment here? Perhaps I will get an idea by reading through it.
Stefan
Stefan
LaTeX.org admin
Re: Long lines do not wrap around in Table of contents
there you go...thanks so much for the help i really appreciate!
- Attachments
-
- Main.log
- (15.87 KiB) Downloaded 331 times
- Stefan Kottwitz
- Site Admin
- Posts: 10340
- Joined: Mon Mar 10, 2008 9:44 pm
Long lines do not wrap around in Table of contents
Hi otnemem,
your logfile shows that your document is loading hyperref. How can this happen? I did not see it in your example. If you find that, follow the message of gmedina above, he already recommended the breaklinks=true option for hyperref.
Or compile directly to pdf, not to dvi.
Stefan
your logfile shows that your document is loading hyperref. How can this happen? I did not see it in your example. If you find that, follow the message of gmedina above, he already recommended the breaklinks=true option for hyperref.
Or compile directly to pdf, not to dvi.
Stefan
LaTeX.org admin
Re: Long lines do not wrap around in Table of contents
Hi stefan...that's strange. i've no idea why hyperref is loading as I never actually used that command. However i tried compiling to pdf directly and it seems to work now! again...thanks for your help.
Long lines do not wrap around in Table of contents
Hi,
After installing MikTex 2.7 I got the same text wrapping problem in the TOC. The solutions presented here (\usepackage[breaklinks=true]{hyperref}) and elsewhere (\usepackage[linktocpage]{hyperref}) have not helped me, as there appears to be a conflict between the harvard package and the hyperref package. I use LEd.
"Latex Error: Option clash for package hyperref"
Any ideas how to sort this out without abandoning the harvard package?
Best
Björn
After installing MikTex 2.7 I got the same text wrapping problem in the TOC. The solutions presented here (\usepackage[breaklinks=true]{hyperref}) and elsewhere (\usepackage[linktocpage]{hyperref}) have not helped me, as there appears to be a conflict between the harvard package and the hyperref package. I use LEd.
"Latex Error: Option clash for package hyperref"
Any ideas how to sort this out without abandoning the harvard package?
Best
Björn
Code: Select all
\documentclass[a4paper]{report}
\usepackage{harvard}
\usepackage[dvips]{graphicx}
\usepackage[left=3.8cm,top=3cm,bottom=3cm,right=3cm]{geometry}
\usepackage{setspace}
\usepackage{lscape}
\usepackage{multirow}
\usepackage{colortbl}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{color}
\setstretch{1.5}
%\usepackage[breaklinks=true]{hyperref}
%\usepackage[linktocpage]{hyperref}
\begin{document}
\tableofcontents
\chapter{Very very long long title Very long title Very long title Very long title Very long title}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10340
- Joined: Mon Mar 10, 2008 9:44 pm
Long lines do not wrap around in Table of contents
LaTeX.org admin
Long lines do not wrap around in Table of contents
Thanks Stefan,
I added this in the syntax given above. I now get an error message as follows:
The error disappears when the \tableofcontents is deleted.
Best
Björn
I added this in the syntax given above. I now get an error message as follows:
Code: Select all
"!Undefined control sequence.
\contentsline ...#2}{#3}\else \ifcase \Hy@linktoc
\csname 1@#1\endcsname {#2...
l.1 ...y long title Very long title}{2}{chapter.1}
?"
Best
Björn
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Long lines do not wrap around in Table of contents
The harvard package loads hyperref on its own so a second try to include hyperref must result in an option clash. Thus the loading sequence has to be changed. If you face further issues, address the maintainer of harvard.
Finally some hints not related to the problem (see code below). Abandon driver options like dvips. The packages that may need them detect on their own which compiler engine is running. For coloured tables it is better to use the xcolor package with an according option. The geometry package offers some options to get the desired result much easier. You are loading the setspace package but you don't use it.
Best regards and welcome to the board
Thorsten¹
Finally some hints not related to the problem (see code below). Abandon driver options like dvips. The packages that may need them detect on their own which compiler engine is running. For coloured tables it is better to use the xcolor package with an according option. The geometry package offers some options to get the desired result much easier. You are loading the setspace package but you don't use it.
Code: Select all
\documentclass[a4paper]{report}
\usepackage[bindingoffset=8mm,includeheadfoot,margin=3cm]{geometry}
\usepackage{graphicx}
\usepackage[onehalfspacing]{setspace}
\usepackage{lscape}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage[table]{xcolor}
%\usepackage[breaklinks=true]{hyperref}
\usepackage[linktocpage]{hyperref}
\usepackage{harvard}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\Blinddocument
\end{document}
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Long lines do not wrap around in Table of contents
Thorsten,
Changing the loading order of hyperref and harvard solved my problem. Thanks a lot for your quick response.
Thanks also for the other tips, I'll look into those.
Best
Björn
Changing the loading order of hyperref and harvard solved my problem. Thanks a lot for your quick response.
Thanks also for the other tips, I'll look into those.
Best
Björn