I was looking for a tooltips package but as fancytooltips
& cooltooltips
doesn't do what I want, I switched for a script which can be found here: Tooltip that works with all pdf readers.
Unfortunately, this script seems a bit limited to me, as it seems it doesn't support linebreaks/text wrapping. As a result, long texts are impossible to embed as a tooltip (see fig.1) or unreadable (see fig.2) and I can't use line breaks (see fig.3), nor some commands, such as \item
which require a carriage return (see fig.4).
If anyone know what should be modified in the original script to support line breaks, please let me know!
Figure 1:
Code:
\documentclass{report}
\usepackage{lipsum}
% Tooltip script below
% ...
% Tooltip script above
\begin{document}
\tooltip{test}{\lipsum}
\end{document}
Output: Error: Dimension too large
(at the line \tooltip{test}{\lipsum}
)
Figure 2:
Code:
\documentclass{report}
% Tooltip script below
% ...
% Tooltip script above
\begin{document}
\tooltip{test}{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}
\end{document}
Output: We can't see all the text of the tooltip, as it's too long.
Figure 3:
Code:
\documentclass{report}
% Tooltip script below
% ...
% Tooltip script above
\begin{document}
\tooltip{test}{foo\\*bar}
\end{document}
Ouput: There is no line break in my tooltip.
Figure 4:
Code:
\documentclass{report}
% Tooltip script below
% ...
% Tooltip script above
\begin{document}
\tooltip{test}
{
\begin{itemize}
\item foo
\item bar
\end{itemize}
}
\end{document}
Output: Error: Something's wrong--perhaps a missing \item
(at the line }
, after the line \end{itemize}
)