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 large document which has to be edited "heavily", so there is a lot of text content which has to be removed for the final version, but I would like to keep it in sight during editing also in the PDF.

So generally said I have to replace e. g. a large paragraph with one or two short sentences and I'd like to still be able to see the original version in the PDF.

I tried to do that with the pdfcomment package and the pdftooltip command, as it does not consume significant space on the page (it is important for me to see how the final document will look) and in general that works well with simple text, but if there is more complex formatting (e. g. an environment), I get error messages.

I tried to build a minimal example:

\documentclass{scrbook}
\usepackage{color, url}
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{pdfcomment}
\newcommand{\weg}[1]{\pdftooltip{\textcolor{red}{\bfseries{}W}}{#1}}

\newcommand{\mycommand}[1]{abc--#1--def}


\begin{document}

test of my command: \mycommand{helloworld}

This is my example text. Here comes the tooltip: \weg{This is the tooltip text. \cite{Author2011} \mycommand{helloworld} $y_1 = x^3 +1$  }

here it fails: \weg{\begin{center} centered text \end{center}} 

\end{document}

The custom command \mycommand which outputs only "text" does not pose a problem, the \cite commands seem to be more problematic, an equation gets "simplified" and some commands just fail.

my questions:

  • how could I change my command \weg{} to print all the latex source code verbatim in the tooltip

  • which type of LaTeX code will likely cause problems with the tooltip?

share|improve this question
3  
Have you tried/considered fancytooltips or cooltooltips? Both these packages allow for more advanced constructs in the PDF tooltip, including formatting. –  Werner Dec 14 '11 at 23:36
    
@Werner: no, I did not know about those 2 alternatives. I'll test them and see if it works better. –  Martin Dec 14 '11 at 23:51
    
@Werner Please turn your comment into an answer. –  lockstep Feb 4 '12 at 23:43

1 Answer 1

up vote 3 down vote accepted

The fancytooltips and cooltooltips packages provide more advanced constructs in the PDF tooltip, including formatting.

Here is a screenshot from the fancytooltips package documentation:

enter image description here

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.