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

share|improve this question
1  
Welcome to TeX.sx! –  mafp Apr 18 '13 at 0:50

1 Answer 1

up vote 2 down vote accepted

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}
share|improve this answer
1  
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

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.