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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This simplest code

\documentclass[a4paper]{book}

\usepackage[ocgcolorlinks]{hyperref}

\begin{document}
    \href{"some URL"}{"long text"}
\end{document}

by compiling with pdflatex puts the "long text" in one line, i.e. with overfull of the line. When the option ocgcolorlinks of the hyperref package is omitted, the text is normally carried over to the next lines.

My question: How can I force the text to be carried over to the next lines with ocgcolorlinks present?

share|improve this question
up vote 6 down vote accepted

Option ocgcolorlinks does not support links that can be broken across lines. From hyperref's README:

  • Main disadvantage: Links cannot be broken across lines. PDF reference 1.7: 4.10.2 "Making Graphical Content Optional": Graphics state operations, such as setting the color, ..., are still applied. Therefore the link text is put in a box and set twice, with and without color.
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.