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.

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
add comment

1 Answer

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
add comment

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.