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 want to be able to magnify (by say 2X) a group of equations in the output of PDFLaTeX by a single click on the box containing them. A second click is to revert to the previous state. The viewer is Adobe Reader.

share|improve this question
1  
Do you have an example PDF file that shows that PDF can do this? –  Peter Grill May 12 '12 at 4:47
3  
The AcroTeX bundle can do this kind of thing. Have a look at their rollover demo. –  Stephan Lehmke May 12 '12 at 12:45
2  
@PeterGrill Other the very useful link provided by Stephan there was this prototype tex.stackexchange.com/questions/12290/… but I had two problems 1) going back to previous view 2) feeding it a set of equations (as opposed to text) –  Maesumi May 12 '12 at 17:33
add comment

1 Answer

up vote 6 down vote accepted

One solution would be to add two copies of the page to the document, one with the small formula and one with the enlarged formula. Then you can use hyperlinks to switch between the pages, effectively toggling the formula between the small and big version. As a proof of concept, try the TeX code below.

Here is the initial document:

enter image description here

Clicking on the formula yields:

enter image description here

Clicking again returns to the first image.

\documentclass{article}

\usepackage{hyperref}
\usepackage{amsmath}

\begin{document}
Click on the formula to make it bigger:
\hyperlink{page.2}{\begin{align*}
  d\bigl(f(t, X_t)\bigr)
  &= \frac{\partial}{\partial t} f(t, X_t) \,dt
    + \sum_{i=1}^d \frac{\partial}{\partial x_i} f(t, X_t) \,dX^{(i)}_t \\
  &\hskip2cm
    + \frac12 \sum_{i,j=1}^d \frac{\partial^2}{\partial x_i \partial x_j} f(t, X_t)
      \,dX^{(i)}_t \, dX^{(j)}_t,
\end{align*}}
Some more text could be here.

\newpage

Click on the formula to make it smaller:
\hyperlink{page.1}{\Large\begin{align*}
  d\bigl(f(t, X_t)\bigr)
  &= \frac{\partial}{\partial t} f(t, X_t) \,dt
    + \sum_{i=1}^d \frac{\partial}{\partial x_i} f(t, X_t) \,dX^{(i)}_t \\
  &\hskip2cm
    + \frac12 \sum_{i,j=1}^d \frac{\partial^2}{\partial x_i \partial x_j} f(t, X_t)
      \,dX^{(i)}_t \, dX^{(j)}_t,
\end{align*}}
Some more text could be here.    
\end{document}

The extra page(s) could be hidden at the end of the document to not disturb the normal sequence of pages.

share|improve this answer
    
Very interesting solution. Wondering why the bounding boxes are drawn so wacky? I added the two images, hope that is ok. –  Peter Grill Jun 24 '12 at 3:08
    
Thanks for the pictures. I guess the bounding boxes are just where the \hyperlink{} command is active. When \hyperlink starts, TeX is still in the middle of the paragraph, the line break etc. only happens in the \begin{align*}. So maybe things look tidier, if empty lines are added before and after the \hyperlink{}? –  jochen Jun 26 '12 at 10:38
add comment

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.