Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem with a too long hyperlink.

This reference is one word, but it is too long and doesn't set the text width, so some part is pushed beyond the margin:

\hyperlink{label}{IS_TOO_LONG_WORD_WITHOUT_ANY_SEPARATORS...}

How to pledge hyperlink to break on a new line (similarly as when LaTeX breaks words across lines)?

share|improve this question
1  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  hpesoj626 Oct 16 '12 at 11:26
1  
It's hard to know how to answer your question without more context. Please add a minimal working example (MWE) that illustrates your problem. –  Andrew Uzzell Oct 16 '12 at 11:27
    
Possible duplicate: Forcing linebreaks in \url –  hpesoj626 Oct 16 '12 at 11:51

1 Answer 1

Hyperref driver with breaklinks support

Then TeX couldn't find break points and the question is not related to hyperref. Solution: Insert break points, e.g. \-, \discretionary, \hyphenation, \penalty, …

Hyperref driver without breaklinks support

From the 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).

Also manual broken links are possible:

\hyperlink{label}{FIRST_PART}%
\hyperlink{label}{NEXT_PART}%
\hyperlink{label}{LAST_PART}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.