summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-breaklinks.html
blob: 89bb86d36a71410d44ad10e8fb3bbef124ac3029 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<head>
<title>UK TeX FAQ -- question label breaklinks</title>
</head><body>
<h3>Link text doesn&#8217;t break at end line</h3>
<!-- hyperref overfull link -->
<p/>When using the <i>hyperref</i> package, you make a block of text
&#8220;active&#8221; when you define a hyper-link (when the user clicks on
that text, the reader program will divert to the <em>target</em> of the
link).
<p/>The <i>hyperref</i> package uses a <em>driver</em> (in the same way
as the <i>graphics</i> package does), to determine how to implement
all that hyper-stuff.
<p/>If you use the driver for <i>dvips</i> output (presumably you want
to distill the resulting PostScript), limitations in the way <i>dvips</i>
deals with the <code>\</code><code>special</code> commands mean that <i>hyperref</i>
must prevent link anchors from breaking at the end of lines.  Other
drivers (notably those for PDFTeX and for <i>dvipdfm</i>) don&#8217;t
suffer from this problem.
<p/>The problem may occur in a number of different circumstances.  For a
couple of them, there are work-arounds:
<p/>First, if you have an URL which is active (so that clicking on
it will activate your web browser to &#8220;go to&#8221; the URL).  In
this case <i>hyperref</i> employs the <i>url</i> package to
split up the URL (as described in 
<a href="FAQ-setURL.html">typesetting URLs</a>), but the
<i>dvips</i> driver then suppresses the breaks.  The way out is
the <i>breakurl</i> package, which modifies the <code>\</code><code>url</code> command
to produce several smaller pieces, between each of which a line break
is permitted.  Each group of pieces, that ends up together in one
line, is converted to a single clickable link.
<p/>Second, if you have a table of contents, list of figure or tables, or
the like, <i>hyperref</i> will ordinarily make the titles in the
table of contents, or captions in the lists, active.  If the title or
caption is long, it will need to break within the table, but the
<i>dvips</i> driver will prevent that.  In this case, load
<i>hyperref</i> with the option <code>linktocpage</code>, and only
the page number will be made active.
<p/>Otherwise, if you have a lengthy piece of text that you want active,
you have at present no simple solution: you have to rewrite your text,
or to use a different PDF generation mechanism.
<dl>
<dt><tt><i>breakurl.sty</i></tt><dd><a href="http://mirror.ctan.org/macros/latex/contrib/breakurl.zip">macros/latex/contrib/breakurl</a> (or <a href="http://mirror.ctan.org/macros/latex/contrib/breakurl/">browse the directory</a>); <a href="http://mirror.ctan.org/help/Catalogue/entries/breakurl.html">catalogue entry</a>
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=breaklinks">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=breaklinks</a>
</body>