General ⇒ Long lines do not wrap around in Table of contents
Re: Long lines do not wrap around in Table of contents
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Long lines do not wrap around in Table of contents
Stefan
Re: Long lines do not wrap around in Table of contents
- Attachments
-
- Main.log
- (15.87 KiB) Downloaded 340 times
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Long lines do not wrap around in Table of contents
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
Re: Long lines do not wrap around in Table of contents
Long lines do not wrap around in Table of contents
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: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Long lines do not wrap around in Table of contents
Long lines do not wrap around in Table of contents
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
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¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Long lines do not wrap around in Table of contents
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