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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can Latex be used to type a math article containing invisible proofs, each of which becomes visible under the relevant theorem when a button or link is clicked?

share|improve this question
Do you mean a hyperlink or something else? – DJP Apr 13 '14 at 0:45
Welcome to TeX.SX! – Heiko Oberdiek Apr 13 '14 at 0:51
Thanks very much for some very helpful answers, although I don't think Optical is a very good way of spelling Optional. – Sanford Smith Apr 14 '14 at 14:26
up vote 7 down vote accepted

You can use fancytooltips; one restriction is that this won't work in most PDF viewers; you need Acrobat Reader:

Your main document will look something like this:




\tooltip{Click here to see the proof.}{proofi}

\tooltip{Click here to see the proof.}{proofii}


the proofs.tex document containing the proofs; I placed every proof inside a tcolorbox, but, of course, you can use the formatting that best suits your needs:




Some test text for the proof; I will include some math expressions for the test:
a ( b + c ) &= ab + ac \\
&= ba + ca \\
&= ( b + c) a


Here we add some other expressions for another proof
I_3 = \begin{bmatrix}
 1 & 0 & 0 \\
 0 & 1 & 0 \\
 0 & 0 & 1 


Here's an image of the output produced by the main document:

enter image description here

And some images of what you get when your mouse hovers over the text "Click here to see the proof.":

enter image description here


enter image description here

share|improve this answer
Unfortunately, I was not able to reproduce the image popup when clicking the blue texts. The texts are clickable with Adobe Reader X using Windows but nothing happens (but the file proofs.pdf exists). Maybe, Adobe Acrobat instead of Adobe Reader in needed ... ? – Thomas F. Sturm Apr 14 '14 at 10:39
@ThomasF.Sturm Weird. I used Adobe Reader to view my document and generate the images. If you want, just to test, I could produce the PDF and send it to you, so you can test with my working PDF? – Gonzalo Medina Apr 14 '14 at 12:51
I just tested on another system. There, it worked. This system has Adobe Reader XI for Windows installed. So, I guess, it's an Adobe Reader version problem. 'X' does not work, 'XI' does. Anyway, thanks for this interesting application :-) – Thomas F. Sturm Apr 14 '14 at 14:23

This can be achieved with Optical Content Groups (OCG). There are some packages that support OCG. A CTAN search revealed the following packages:

Example for ocgx (randomly choosen):

\noindent My theorem.
\begin{ocg}{OCG 1}{ocg1}{0}
My proof.
\switchocg{ocg1}{\fbox{Toggle proof}}

The package requires pdflatex (or lualatex) and at least two LaTeX runs are needed. (The rerun warning is missing.)

The text "My proof." should be invisible first. After pressing "Toggle proof" the proof should appear.

However, OCGs are not supported by all PDF viewers.

share|improve this answer

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.