# LaTeX2rtf with pdftooltip

I'm using LaTeX2rtf to convert LaTeX article or report documents into rich text format. I also compile the PDF using pdfLaTeX. In my document, I use the pdfcomment package to create tooltips.

\documentclass{article}
\usepackage{pdfcomment}
\begin{document}
\pdftooltip{$a^2+b^2=c^2$}{An equation}
\end{document}


The tooltips are correctly rendered in the PDF version.

However, when I run

latex2rtf


\pdftooltip[*options*]{*item*}{*tooltip*} is rendered as item and tooltip. If item is a float, or equation, then the float or equation is shown. tooltip is always shown as text.

This is correct as far as LaTeX2rtf is concerned, but I would like to modify this behavior so that I don't have to tidy up my document too much.

Question: How can I force LaTeX2rtf to ignore tooltip and just process the item argument? I am looking for a solution that will work with a document that contains lots of \pdftooltips, so using the \iflatextortf switch doesn't really work (too much added complexity). Ideally I would be able to define something in the preamble or pass an option to LaTeX2rtf.

-
Welcome to TeX.sx! – mafp Apr 18 '13 at 0:50

Without modifications to the latex2rtf program code, the only way is conditional processing. Latex2rtf automatically sets the \iflatex2rtf condition true, while for pdflatex it is false by default.

\documentclass{article}
\usepackage{pdfcomment}
\newif\iflatextortf
\begin{document}
\iflatextortf
$a^2+b^2=c^2$
\else
\pdftooltip{$a^2+b^2=c^2$}{An equation}
\fi
\end{document}

-
Welcome to TeX.sx! – mafp Apr 19 '13 at 8:15
Close! This would work if I had one or two \pdftooltips' to deal with. Unfortunately I need this to work in documents with many of these. I've modified the original request to reflect this. – Andy Clifton Apr 19 '13 at 15:29
@Wilfried; I took your suggestion and used the \iflatextortf switch in the preamble. There I defined a new \pdfcomment as \newcommand{\pdftooltip}[3][]{#2}`. My document now compiles nicely in both PDFLatex and latextortf, with no re-writing. – Andy Clifton Apr 21 '13 at 20:15