Installation and usage of the fancytooltips package
There are several packages available that make it possible to insert tooltips into LaTeX generated PDF files, see e.g. fancytooltips, cooltooltips, ocgx, and some simplistic solutions like INSERT THE ONE WITH A SIMPLE TEX FILE AT HOME. Some features of these packages:
- cooltooltips
- shows pretty basic tooltips and mouse hovering does not work, just mouse clicking
- requires Adobe Reader
- pdfcomment
- as its name suggests, the tooltips are realized as comments
- requires Adobe Reader
- ocgx
- highly customizable layers which show up or disappear on clicking
- interoperability with TikZ
- does not rely on Javascript -> can be used for other viewers than Acrobat Reader (e.g. Evince)
- powerful (see e.g. this demo) but has steep learning curve
- fancytooltips
- no need to modify the source .tex file for effects, just include the fancytooltips header; it will automatically cut the clickable references
- possibility to include additional tooltips and animations manually (see the examples)
- requires perl, Adobe Reader and the packages ocg, acrotex
Theoretically, on-the-fly package installation should work with MiKTeX, but I had so many problems with it that for the sake of fancytooltips, I installed the full MiKTeX.
- Install the fancytooltips and the acrotex packages.
- fancytooltips is part of both TeXlive and MiKTeX: https://www.ctan.org/pkg/fancytooltips?lang=en
- acrotex is available in the MiKTeX package manager or can be manually downloaded from CTAN: https://www.ctan.org/pkg/acrotex?lang=en
- Install the ocg package. For me, neither the ocgx, nor the ocg-p packages worked with fancytooltips, so we need to install the original ocg:
- download ocg.sty (e.g. http://mirrors.ctan.org/graphics/asymptote/doc/ocg.sty)
- create a directory called ocg in /MiKTeX_dir/tex/latex and put ocg.sty into it.
- in MiKTeX Options, on the General tab, click on Refresh FNDB and on Update Formats
- Install perl. The author of the fancytooltips recommends ActivePerl for Windows: http://www.activestate.com/activeperl. It is easy to manage the perl modules with it, what we will need in the next step
- Open the Perl Package Manager and install the Config::IniFiles module.
It is recommended to create an .ini file that holds your settings so that you don't have to modify fancy-preview.
Call fancy-preview from the command prompt:
perl fancy-preview fileNameWithoutExtension -options
With the example files of this repository:
perl fancy-preview mwe --ini_file=settings.ini
I managed to modify the fancy-preview script to work with biber. However, it only works if the .bbl file has already been created. Unfortunately, it does not extract the bibliography, only the references. The fancy-preview script is licensed with the LaTeX Project Public License. According to it: "Distribution of only part of the Work is considered modification of the Work, and no right to distribute such a Derived Work may be assumed under the terms of this clause", so I cannot upload it here.
Currently there are some limitations of the fancy-preview script:
- it is hard-coded for bibtex and not for biber
- requires Adobe Reader/Acrobat
- cropping with pdfcrop can can result in (relatively) large file sizes as is mentioned in the manual too. You can use pdftk instead.
If you have solutions for the improvements above or any other recommendations, feel free to send a pull request.
If you find any problems with this tutorial, raise an issue.