пятница, 15 мая 2009 г.

Длинные строки в оглавлении + DVI + hyperref

Пакет hyperref в чистовом latex режиме почему-то не переносит строки в TOC.

Вот что говорят в Google Groups:

I've found a strange behavior of line breaking in TOC when using 
hyperref. If pdflatex produces pdf line breaking is OK. When pdflatex 
produces dvi line breaking is disallowed which causes overfulls. What 
does this mean? 


Minimal example 
\documentclass[a5paper]{book} 
\usepackage{hyperref} 
\begin{document} 
\tableofcontents 
\chapter{Very long chapter header. Long, long, long. Exceptionally 
long} 
\section{Very long section header. Long, long, long. Exceptionally 
long} 
\section{Typical section header} 
\end{document}

Heiko Oberdiek Просмотреть профиль Translate to Русский 
  Дополнительные параметры 1 дек 2007, 12:30 


tsy wrote: 
> I've found a strange behavior of line breaking in TOC when using 
> hyperref. If pdflatex produces pdf line breaking is OK. When pdflatex 
> produces dvi line breaking is disallowed which causes overfulls. What 
> does this mean? 

README: 

| 7 LIMITATIONS 
| ============= 

| * Wrapped/broken link support 

| Only few drivers support automatically wrapped/broken links, 
| e.g. pdftex, dvipdfm, hypertex. Other drivers lack this 
| feature, e.g. dvips, dvipsone. 

| Workarounds: 
| * For long section or caption titles in the table of contents 
| or list of figures/tables option "linktocpage" can be used. 
| Then the page number will be a link, and the overlong section 
| title is not forced into an one line link with overvull \hbox 
| warning. 
| * "\url"s are caught by package "breakurl". 
| * The option "breaklinks" is intended for internal use. But it 
| can be used to force link wrapping, e.g. when printing a 
| document. However, when such a document is converted to PDF 
| and viewed with a PDF viewer, the active link area will be 
| misplaced. 
| Another limitation: some penalties are "optimized" by TeX, 
| thus there are missing break points, especially within 
| \url. (See thread "hyperref.sty, breaklinks and url.sty 3.2" 
| in comp.text.tex 2005-09). 

Yours sincerely 
  Heiko

Резюме:

  1. используем опцию 'linktocpage=true'
  2. используем пакет 'breakurl'

вторник, 12 мая 2009 г.