# Fancy-preview

### perl script for enhancing PDF documents written by LaTeX (Win/Linux)

#### Introduction

The script fancy-preview is a script which can be used to extract displayed equations, theorem-like environments, figures and bibliography references and attach this material as tooltip to LaTeX \ref, \eqref and \cite comand. This has been requested by several (pdf)(La)TeX users. See this link for some discussion and papers 1 and 2 as demos of interactive PDF with similar properties. Interested? Basicaly I converted the papers from the bottom of the current page to the fancytooltips enhanced versions by adding \usepackage{hyperref}, checking that each \bibitem is followed by blank line and compiling by "perl fancy-preview paper" instead of "pdflatex paper.tex". The compilation is about three times slower and the filesize about two times bigger.

Below you find static pictures, demo and real examples.

#### User documentation

For short explanation how to use the script see the manual to fancytooltips package, the comments inside the fancy-preview script itself and the help.

### Pictures

Lemma (enviroment lemma):

Citation in text:

Displayed equation:

### Showcase

The examples have been compiled with the script compile and with the following files. Basicaly, you can find here PDF files with hyperref links. Each link is followed by a button in fancy-tooltiped version. This button is invisible in mathematical papers and blue soap in presentations. Mouseover action on this button opens the tooltip.

#### Presentations

 Presentation enhanced PDF classic PDF TeX source presentation 1 PDF PDF TeX presentation 2 PDF PDF TeX

#### Papers

 Paper enhanced PDF classic PDF TeX source paper 2 PDF PDF TeX paper 4 PDF PDF TeX paper 5 PDF PDF TeX paper 6 PDF PDF TeX paper 7 PDF PDF TeX paper 8 PDF PDF TeX paper 9 PDF PDF TeX

#### Demo files

 Demo enhanced PDF classic PDF TeX source previewreferencesdemo PDF PDF TeX biblatex-test PDF PDF TeX fancy-preview-demo PDF PDF TeX

#### Complex demo files

Here you can find large presentations (screen versions of texbooks) created by fancy-preview script.
• Math 1
• The classical pdflatex compilation takes 3 sec and the file size is 774K
• The compilation using this program to crop PDF takes 1 minute 12 sec and the file size is 1.6M.
• The compilation using pdfcrop from TeXlive (default setting) takes 3 minutes 8 sec and the file size is 6.7M.
• Math 2
• Math 0
• Applied Math

#### Known real world applications of fancytooltips or fancy-preview

All the files in the following table come from the same TeX source. The difference is only in the config files. Note the line \ifx\PreviewEnvironment\undefined\pagecolor{blue!10}\fi which sets the pagecolor only if the preview package is not active. Also note that all figures are inside minipage environments. This allows to extract figures either by extracting figure or minipage. The command line to produce these examples is fancy-preview ini-demo --ini_file=inifile.ini
 ini file PDF size preview (click to download PDF file) comments 0.ini 390.71 K the biggest filesize (pdfcrop)two figures in one float are extracted together no tooltip for remarks 1.ini 224.67 K text in the tooltips is wrapped to different textwidth than in the original document three compilations to split previews for Figures 2 and 3 2.ini 222.06 K like the previous example, but we use blue soap to denote tooltips and the toltips to equations show the whole enclosing environment the tooltip on the picture follows reference to equation (3) 3.ini 224.46 K customized tooltip appearance(gradient, no shadow, bigger margins)text in the tooltips is wrapped to different textwidth than in the original document the punctation at the end of the tooltips to equations is thrown away

### Installation

All operating systems: you can donwload the script here. You need pdflatex, fresh fancytooltips.sty and Acrotex eDucation Bundle (eforms.sty and insdljs.sty). You also need working Perl installation (is usually available in Linux, on Windows you can install from http://www.activestate.com/activeperl) You also need Perl library Config::IniFiles.

### Tips for users

See the manual to fancytooltips and the examples.