Sign up ×
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 am constructing a memorization list for the terms in a paper I am reading. What I would like to do is create a PDF with a term to be defined, and have the definition "hidden" underneath the definition, so that after I have written the definition on paper, I could check the answer was correct simply by clicking (say) a triangle underneath the term to be defined. For example,

Definition: Character of a Group Representation

And the text to unfold beneath it (but not be visible before I've attempted to memorize it):

Let $\sigma\colon G\to \mathsf{GL}(\mathbb{C}^{n})$ be a representation of a group $G$. The character of $\sigma$ to be the function $\chi_{\sigma}\colon G\to \mathbb{C}$ by $\chi_{\sigma}(x):=\mathrm{Tr}\sigma(x)$.

Does anyone know how to do this? I thank you all for your time in advance.

share|improve this question
I would imagine this to be possible, to some extent, using PDF/HTML forms, offered by hyperref. Specifically, read section 6 PDF and HTML forms. – Werner Apr 18 '12 at 19:39

3 Answers 3

up vote 7 down vote accepted

One option would be to use the fancytooltips package. A little example follows:

First, you create the PDF file containing the tooltips (one per page). You can do this using latex; for your example, I used the following practice.tex document (mdframed was used to present the tooltips using a nice colored framed box with a shadow, but of course you can decorate the tooltips as you wish):


Let $\sigma\colon G\to \mathsf{GL}(\mathbb{C}^{n})$ be a representation of a group $G$. The character of $\sigma$ to be the function $\chi_{\sigma}\colon G\to \mathbb{C}$ by $\chi_{\sigma}(x):=\mathrm{Tr}\sigma(x)$.



This document has to be processed to obtain practice.pdf. Now you create your main document (notice that the name used in filename= is precisely the name of the file practice.pdf containig the tooltips):



\tooltip*{Definition: Character of a Group Representation}{character}


In the main document, the tooltips will now be invisible until you click on the little blue ballon.

An image of the obtained document without uncovering the tooltip:

enter image description here

And now an image of the obtained document with the tooltip:

enter image description here

This approach doesn't work in all PDF viewers, since it requires cooperation with JavaScripts; you have to use Adobe Reader or Adobe Acrobat to see the tooltips.

share|improve this answer

Check out pdfcomment.sty, I guess it does exactly what you wish. In the following example however the $sigma$is not displayed in the PDF.


Character of a Group Representation\pdfsquarecomment{Let $\sigma$ be a representation of a group $G$.}

share|improve this answer

Character of a Group Representation\answer{Let $\sigma\colon G\to      
\mathsf{GL}(\mathbb{C}^{n})$ be a representation of a group $G$. The 
character of $\sigma$ to be the function $\chi_{\sigma}\colon G\to 
\mathbb{C}$ by $\chi_{\sigma}(x):=\mathrm{Tr}\sigma(x)$.}


This is a modification of previous answers. The result looks as follows: link *Oops, I cannot post image as new user. Compile the file two or three times. You should get PDF with the text "Character of a Group Representation??" and if you click ?? in Adobe Reader (Javascripts are necessary), yellow rectangle with aditional text appears. You can close this yellow text by clicking ?? again, or clicking the red crossmark or simply press Enter (the button with red cross has keyboard focus). *

The advantage when comparing to the previous answers are that everything is in one file (in contrast to fancytooltips solution) and math is supported (in contrast to pdfcomment solution).

Hope this helps. This is my first post here, I was no able to find out how to continue the first answer (written by Uwe Ziegenhagen) and for this reason I post it here as third solution, even though it is in fact a modification of Uwe's answer.

EDIT: It has been reported in the discussion below that this solution does not work for some users. For now, I uploaded the TeX, PDF and png file with this example to

If you need a solution which does not depend on Javascripts and works in all PDF browsers, you may have a look at Acrotex education bundle and the environments excersize and solution. Like this.


  Character of a Group Representation
    Let $\sigma\colon G\to
    \mathsf{GL}(\mathbb{C}^{n})$ be a representation of a group
    $G$. The character of $\sigma$ to be the function
    $\chi_{\sigma}\colon G\to \mathbb{C}$ by
share|improve this answer
TeX-live 2011 does not include all the necessary packages for your first code, eforms.sty seems missing. As you seem to be the author of the ocgtools.sty: Why is it not in TeXlive? And how many packages are necessary, which are not included? If more than eforms: Is there a single website where I can get them? Your package seems interesting! – Keks Dose May 4 '12 at 9:04
Hello, according to, the ocgtools package is on Texlive. To insert javascripts you need eforms nad insdljs from Acrotex eDucation bundle - this bundle can be downloaded from CTAN or or author's page – May 4 '12 at 9:10
Misunderstanding, bad question, sorry: eforms.sty is missing in TeXlive. – Keks Dose May 4 '12 at 9:15
Thanks for pointing this out. I do not know why eforms.sty and insdljs.sty are not on Texlive. I think, they were few years ago. Anyway, if these packages are missing, then solution with fancytooltips also does not compile. To install these packages download acrtex education bundle, put it to the .TeX directory (on Linux) and run "pdflatex acrotex.ins" – May 4 '12 at 9:22
Sorry, this is not a real solution. First, you have to run LaTeX three times, otherwise the pdf is simply black. And then Adobe Reader says, a certain module for JavaScript were missing. 'quitting. – Keks Dose May 4 '12 at 9:52

Your Answer


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.