[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#227398: hyperref destroys hyphenation of ToC



Juhapekka Tolvanen <juhtolv@cc.jyu.fi> schrieb:

> On Wed, 14 Jan 2004, +18:19:12 EET (UTC +0200),
> Hilmar Preusse <hille42@web.de> pressed some keys:
>
>> On 13.01.04 Frank Küster (frank@kuesterei.ch) wrote:
>
>> > Could you give a short example document? I cannot imagine a section
>> > heading long enough to make hyphenation necessary, so I couldn't
>> > test...
>
>> drachi:[hille] >more a.tex
>> \documentclass[12pt]{article}
>> \usepackage{german}
>> \usepackage[a4paper]{hyperref}
>> %\usepackage[a4paper,dvips]{hyperref}
>> \newcommand{\donau}{Donaudampfschiffahrtsgesellschaftskapit"ansjacke}
>> \begin{document}
>> \tableofcontents
>> \section{\donau\ \donau}
>> \donau\ \donau
>> \end{document}
>
>
> Thank you very much!
>
> I tried compiling that code in my machine. Both with and without option
> "dvips" hyperref-package detroys hyphenation of ToC, when using vanilla
> latex-command. 

This is the same here, and it is contrary to the hyperref documentation:
It says that if no backend driver is specified, hypertex will be loaded;
but with \usepackage[a4paper,hypertex]{hyperref} and vanilla latex one
gets a different behaviour (the ToC is hyphenated). I'll report this one
to Heiko.

> pdflatex has no problems.

hyperref detects that it is run by pdflatex and automatically loads the
pdftex backend driver.

> Somebody suggested option breaklinks and it really helps. Thanks!
> I'll use it from this time forward.
>
> I really don't know, what should be done for that bug. Maybe it is so
> difficult to fix, that breaklinks-option is always needed as a
> workaround. Or maybe breaklinks-options should true by default with
> every driver. I just don't know, if that will cause some problems.

I think this is not a question of "wrong or right", in fact it means
sailing between Scylla and Charybdis. The dvips-ps2pdf combination
cannot handle links broken over two lines, unless dvips is called with
the -z option. But this option bloats the ps files by including a lot of
stuff that is usually unneeded and unwanted. This is Scylla, and it is
avoided by not making -z the default for dvips. Charybdis is to get no
hyphenation in the tableof... environments, or to force hyphenation with
[breaklinks], but to get ugly links in pdf files produced via
dvips-ps2pdf.

Just as for Odysseus, there is no safe way around, you just can try to
navigate, steering the right way every moment:

- If you want to use the same file to produce pdf with pdflatex and
  dvi/ps with latex, use [hypertex] or [dvips,breaklinks] for the latex
  case. Once the hyperref bug is fixed and it really loads hypertex by
  default, you can use \usepackage{hyperref} without driver option.

- If you want to produce pdf files via latex-dvips-ps2pdf, you have two
  options to get hyphenation within the tableof...:

  * either use \usepackage[dvips]{hyperref} (or no driver specification,
    at the moment), --> dvips --> ps2pdfb, and live with the ugly links
    (coloring/underlining/click effect only in the first line).

  * or use \usepackage[hypertex]{hyperref} (or no driver specification
    once hyperref behaves as documented) and remember to give dvips the
    -z switch.


> Well, many software manuals has a section called "Troubleshooting". Maybe
> upstream author should add such section to documentation of hyperref.

I'll talk about that with Heiko.

Bye, Frank
-- 
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie




Reply to: