# How to carry long text of \href to the next line while ocgcolorlinks is present?

This simplest code

\documentclass[a4paper]{book}

\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?

-
–  diabonas Mar 26 '13 at 12:12

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.
-