3

Sometimes using hyperref can produce overfull boxes because hyperref does not seem to allow its hyperlinks to be broken into multiple linesenter image description here

For exampled the italicized text in the highlighted bibliography entry contains a hyperlink which may be broken into two lines. How do I make it happen?

I can't use pdflatex as I am using eps images. Using XeLaTeX produces figures at arbitrary places as shown below:

Figure at wrong place

I think this happens due to a conflict of packages that I have. These are all the packages that I am currently using:

\documentclass[paper=A4, fontsize=12, toc=listof, toc=bib]{scrreprt}
\usepackage[inner=2.5cm, outer=2cm, bottom=3cm]{geometry}
\usepackage[super,sort&compress]{natbib}
\usepackage{natmove}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{lmodern}
\usepackage[hypcap]{caption}
\usepackage{imakeidx}
\usepackage[hidelinks]{hyperref}

Only pdf chain produces the correct output except for the overfull hyperlinks ofcourse.

4
  • Are you using latex + dvips + ps2pdf by any chance?
    – Joseph Wright
    Commented Jan 12, 2014 at 9:26
  • Yes, I use 'latex + dvips + ps2pdf'.
    – DKS
    Commented Jan 12, 2014 at 10:29
  • 2
    hyperref can break links if you use pdflatex Commented Jan 12, 2014 at 10:47
  • Can't use pdflatex. Question edited.
    – DKS
    Commented Jan 13, 2014 at 6:31

1 Answer 1

2

From hyperref's README:

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.

  • \urls 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).

2
  • What's the syntax of using breakurl. Because \usepackage{breakurl} does not seem to be working. Other options in the documentation, like anythingbreaks, are too extreme.
    – DKS
    Commented Jan 13, 2014 at 7:19
  • @DKS: Package breakurl's main point are URLs. \url is redefined by default, also \burl can be used. There is also \burlalt, see the documentation of package burl. I cannot say anything to the example, because a minimal example file is missing that would show, what is a link and how it is generated. Commented Jan 13, 2014 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .