summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fancytooltips
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/fancytooltips
Initial commit
Diffstat (limited to 'macros/latex/contrib/fancytooltips')
-rw-r--r--macros/latex/contrib/fancytooltips/cite.pngbin0 -> 38202 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.pdfbin0 -> 544887 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.sin.table29
-rw-r--r--macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.tex278
-rw-r--r--macros/latex/contrib/fancytooltips/examples/fancy-preview-demo2.pdfbin0 -> 399799 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/examples/fancy-preview-demo2.tex691
-rw-r--r--macros/latex/contrib/fancytooltips/examples/fancytooltips-example.pdfbin0 -> 312830 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/examples/fancytooltips-example.tex55
-rw-r--r--macros/latex/contrib/fancytooltips/examples/pics/tecna2.pdfbin0 -> 86631 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/examples/pics/tooltipy.pdfbin0 -> 262180 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/examples/pics/tooltipy.tex103
-rw-r--r--macros/latex/contrib/fancytooltips/examples/pics/tooltipy.tips3
-rw-r--r--macros/latex/contrib/fancytooltips/examples/readme5
-rw-r--r--macros/latex/contrib/fancytooltips/fancy-preview448
-rw-r--r--macros/latex/contrib/fancytooltips/fancytipmark.eps37
-rw-r--r--macros/latex/contrib/fancytooltips/fancytipmark.pdfbin0 -> 1245 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/fancytipmark.svg70
-rw-r--r--macros/latex/contrib/fancytooltips/fancytipmark1.pdfbin0 -> 1065 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/fancytipmark2.pdf67
-rw-r--r--macros/latex/contrib/fancytooltips/fancytipmark3.pdfbin0 -> 1111 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/fancytipmark4.pdfbin0 -> 1123 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/fancytooltips.dtx1415
-rw-r--r--macros/latex/contrib/fancytooltips/fancytooltips.ins58
-rw-r--r--macros/latex/contrib/fancytooltips/fancytooltips.pdfbin0 -> 297480 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/readme17
-rw-r--r--macros/latex/contrib/fancytooltips/tip.pdfbin0 -> 32810 bytes
-rw-r--r--macros/latex/contrib/fancytooltips/tip.tex30
27 files changed, 3306 insertions, 0 deletions
diff --git a/macros/latex/contrib/fancytooltips/cite.png b/macros/latex/contrib/fancytooltips/cite.png
new file mode 100644
index 0000000000..8ea4534185
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/cite.png
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.pdf b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.pdf
new file mode 100644
index 0000000000..b1c5c66d96
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.sin.table b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.sin.table
new file mode 100644
index 0000000000..e1383fb5ff
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.sin.table
@@ -0,0 +1,29 @@
+#Curve 0, 25 points
+#x y type
+0.00000 0.00000 i
+0.26167 0.25869 i
+0.52333 0.49977 i
+0.78500 0.70683 i
+1.04667 0.86576 i
+1.30833 0.96575 i
+1.57000 1.00000 i
+1.83167 0.96617 i
+2.09333 0.86656 i
+2.35500 0.70795 i
+2.61667 0.50115 i
+2.87833 0.26023 i
+3.14000 0.00159 i
+3.40167 -0.25715 i
+3.66333 -0.49839 i
+3.92500 -0.70570 i
+4.18667 -0.86496 i
+4.44833 -0.96534 i
+4.71000 -1.00000 i
+4.97167 -0.96658 i
+5.23333 -0.86735 i
+5.49500 -0.70907 i
+5.75667 -0.50253 i
+6.01833 -0.26177 i
+6.28000 -0.00319 i
+
+
diff --git a/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.tex b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.tex
new file mode 100644
index 0000000000..e5361d82a5
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo.tex
@@ -0,0 +1,278 @@
+%\documentclass{article}
+\documentclass[envcountsect,t,10pt]{beamer}
+
+%\usetheme{Ilmenau}
+%\usetheme{Marburg}
+%\usetheme{PaloAlto}
+
+\setbeamertemplate{theorems}[numbered]
+\usepackage{amsthm,amsmath,graphicx,color}
+
+\usepackage{tikz}
+\PassOptionsToPackage{naturalnames}{hyperref}
+
+\newtheorem{remark}{Remark}
+\def\dx{{\mathrm d}x}
+\definecolor{darkgreen}{rgb}{0,0.6,0}
+
+\usepackage[inactive]{fancytooltips}
+\begin{document}
+
+\title{Fantytooltips demo}
+\author{Robert Ma\v{r}\'ik}
+
+\maketitle
+\section{Introduction}
+
+\begin{frame}{Content}
+ \tableofcontents
+\end{frame}
+\begin{frame}
+ \frametitle{What can you find in this file?}
+ \begin{itemize}
+ \item Demo (math fiction) which shows how the cooperation between
+ preview and fancytooltips package can be used to insert popup
+ previews for equations, theorems and definitions into a
+ presentation -- see for example Figure \ref{pic:sine} (move the
+ mouse to the blue mark).
+ \item Explanation how we achieved this behaviour.
+ \end{itemize}
+\end{frame}
+
+\section{Math text example}
+
+\begin{frame}{Demo: Definitions}
+ \begin{definition}[Excellent number{\cite[citation only for testing]{D-1}}]
+ Let $n$ be positive integer. The number $n$ is said to be
+ \textit{excellent}, if the last digit of the number $\alpha$
+ defined by the relation
+ \begin{equation}
+ \label{eq:excel}
+ \alpha = n^2 +\int_0^{2\pi}\sin x\dx
+ \end{equation}
+ equals $1$.\label{def:excellent-number}
+ \end{definition}
+
+ {(Note that from \eqref{eq:excel} it follows that $\alpha$ is
+ integer, see \ref{eq:sin}.) }
+
+ {\begin{definition}[Happy number]
+ Let $n$ be positive integer. The number $n$ is said to be
+ \textit{happy}, if the last digit of the number $n$ equals $1$.
+ \label{def:happy-number}
+ \end{definition}}
+
+ {Citations are also extracted. See \cite{D,D-R,D-F,D-Rez}. You
+ \textit{have to} insert emtpy line after each \texttt{\textbackslash
+ bibitem} command. Ordinary \tooltip{tooltips}{hodnost} and
+ \tooltipanim{animations}{4}{28} also work.}
+ \end{frame}
+
+\begin{frame}{Demo: Example and comments}
+\begin{example}
+ The number $1$ is both happy and excellent. The number $129$ is
+ excellent but not happy. This follows immediately from the
+ Definitions \ref{def:excellent-number} and \ref{def:happy-number}.
+\end{example}
+\begin{alertblock}{Fancytooltips comment}
+ Put the mouse pointer to the graphical symbol following definitions
+ numbers. You will see the definitions again. We can also refer to
+ equation, like this: \eqref{eq:excel}. Note that the same reference
+ has been used on previous slide and the tooltip has not been
+ attached, since the reference to \eqref{eq:excel} on the previous
+ page is at the same page as its target.
+\end{alertblock}
+\end{frame}
+
+
+\begin{frame}{Demo: A picture}
+ \begin{figure}
+ \centering
+\begin{tikzpicture}[domain=0:6.28]
+ \draw[->] (0,0) -- (7,0) node[right] {$x$};
+ \draw[->] (0,-1.2) -- (0,1.2) node[above] {$f(x)$};
+ \shadedraw[color=black,top color=blue,bottom color=red]
+ plot[id=sin] function{sin(x)};
+\end{tikzpicture}
+ \caption{Sine curve}
+ \label{pic:sine}
+ \end{figure}
+
+ On one of the previous slides (in Definition \ref{def:excellent-number})
+ we defined \textit{excellent} number in terms of the number $\alpha$
+ defined by relation \eqref{eq:excel}. Below we introduce a simple
+ characterization in Theorem \ref{theorem}.
+\end{frame}
+
+\begin{frame}{Demo: Newton--Leibniz theorem}
+
+ \begin{theorem}
+ Let $f(x)$ be integrable in the sense of Riemann on $[a,b]$. Let
+ $F(x)$ be a function continuous on $[a,b]$ which is an
+ antiderivative of the function $f$ on the interval $(a,b)$. Then
+ \begin{equation*}
+ \int_a^bf(x)\dx=[F(x)]_a^b=F(b)-F(a)
+ \end{equation*}
+ holds.\label{th:NL}
+ \end{theorem}
+\end{frame}
+
+\begin{frame}{Demo: Integral term equals zero}
+ \begin{remark}
+ It is easy to see that
+ \begin{equation}
+ \label{eq:sin}
+ \int_0^{2\pi}\sin x\dx=0.
+ \end{equation}
+ Really, direct computation based on Newton-Leibniz Theorem
+ \ref{th:NL} shows
+ \begin{align*}
+ \int_0^{2\pi}\sin x\dx&=[\cos x]_0^{2\pi}\\
+ &=\cos(2\pi)-\cos 0\\
+ &=0.
+ \end{align*}
+ (see also Figure \ref{pic:sine})
+ \end{remark}
+\end{frame}
+
+\begin{frame}
+ \frametitle{Demo: Main result}
+ \begin{theorem}[Characterization of excellent numbers]
+ The positive integer $n$ is
+ \tooltip{excellent}{def:excellent-number} if and only if the last
+ digit of the number $n$ is either $1$ or $9$.
+ \label{theorem}
+ \end{theorem}
+
+\begin{alertblock}{Fancytooltips comment}
+ Since we used {\color{red}\texttt{\textbackslash
+ label\{def:excellent-number\}}} in the Definition
+ \ref{def:excellent-number}, we can insert a tooltip to the word
+ excellent by using command{\color{red} \texttt{\textbackslash
+ tooltip\{excellent\}\{def:excellent-number\}}}. In this case the
+ tooltip is activated by hovering the text, not the soap. This is the
+ default behavior of fancytooltips.
+\end{alertblock}
+
+\end{frame}
+
+\begin{frame}
+ \frametitle{Demo: Corollary}
+ \begin{theorem}[Relationship between happy and excellent numbers]
+ Each \tooltip*{happy}{def:happy-number} number is
+ \tooltip{excellent}{def:excellent-number}.
+ \end{theorem}
+
+\begin{alertblock}{Fancytooltips comment}
+ The ``happy'' tooltip is created by
+ \texttt{\color{red}\textbackslash
+ tooltip*\{happy\}\{def:happy-number\}}. The starred version causes
+ that the active button is not attached to the text, but is attached
+ to the mark. The ``excellent'' tooltip is created by
+ \texttt{\color{red}\textbackslash
+ tooltip\{excellent\}\{def:excellent-number\}} and hence, the blue soap is
+ inactive and the text active.
+\end{alertblock}
+\end{frame}
+
+\section{How it works}
+\begin{frame}
+ \frametitle{How it works}
+ \begin{itemize}
+ \item We compile the presentation in an ordinary way to get correct
+ labels and references.
+ \item We compile the presentation with preview package and extract
+ displayed equations, theorems, definitions and floats (tables and
+ figures).
+ \item We create a new document which contains those parts extracted
+ in the previous step, which have a label inside.
+ \item We compile the presentation again with redefined \texttt{ref}
+ macro. This macro inserts the popup using fancytooltips package.
+ \end{itemize}
+\end{frame}
+
+% \section{Short howto}
+% \begin{frame}
+% \frametitle{How to create a presentation with pdf\LaTeX}
+% % Creating tooltips is easy. Simply follow these steps.
+% \begin{itemize}
+% \item Create presentation with your favorit presentation package,
+% such as
+% \href{http://www.ctan.org/tex-archive/help/Catalogue/entries/acrotex-web.html}{\color{blue}web},
+% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/pdfscreen/}{\color{blue}pdfscreen}
+% or
+% \href{http://www.ctan.org/tex-archive/help/Catalogue/entries/beamer.html}{\color{blue}beamer}.
+% \item In Linux use the script \texttt{fancy-preview} to compile the
+% presentation again, i.e. if your file is filename.tex run
+% \begin{quote}\upshape\color{darkgreen}
+% \texttt{bash fancy-preview filename}
+% \end{quote}
+% On Windows use (still experimental)
+% \begin{quote}\upshape\color{darkgreen}
+% \texttt{fancypreview.bat filename}
+% \end{quote}
+% \item You may want to customize the variables in the script
+% \texttt{fancy-preview} or batch file
+% \texttt{fancypreview.bat} (colors, options for fancytooltips,
+% etc.)
+% \end{itemize}
+% \end{frame}
+
+% \begin{frame}
+% \frametitle{How to create a presentation with dvips}
+% \begin{itemize}
+% \item This work-flow should still work with dvips, but has been not
+% tested, since it
+% requires Acrobat Professional which is not available on author's
+% platform (\texttt{Linux}). Moreover, the compilation cannot be
+% done automatically, due to the post-processing in Acrobat. You
+% are encouraged to try it by yourselves. Report success of problems
+% to the authors email, please.
+% \item Basically follow the instructions for pdf\LaTeX{} users.
+% \item You have to customize the script \texttt{fancy-preview}
+% \begin{itemize}
+% \item Replace \texttt{pdflatex} by \texttt{latex}
+% \item Add commands which convert \texttt{minimal.ps} into
+% \texttt{minimal.pdf}
+% \item Extract the number of pages of the file
+% \texttt{minimal.pdf} and pass it as an argument to the
+% fancytooltips package. (You may use \texttt{pdftk} or
+% \texttt{pdflatex} for this task.)
+% \end{itemize}
+% \item Remember that you have post-process the resulting
+% \texttt{ps} file as described in manual for fancytooltips
+% package.
+% \end{itemize}
+% \end{frame}
+
+
+\begin{frame}
+ \frametitle{That's all. }
+ Any problem? Send a \textit{minimal example} to the author of the
+ package.
+\end{frame}
+
+\begin{thebibliography}{10}
+\bibitem{D-1} {K. Nowak}, A remark on \dots , Opuscula Math. {\bf 26}
+ (2004), 25--31.
+
+\bibitem{D} {R. Stuchlik}, Perturbations of \dots ,
+ J. Math. Anal. Appl. {\bf 23} (19986), 4--44.
+
+\bibitem{D-F} {O. Stuchlik}, Half-linear oscillation criteria:
+ Perturbation in term involving derivative, Nonlinear Anal. {\bf 73}
+ (2010), 3756--3766.
+
+\bibitem{D-R} {T. Topas}, Half-linear Differential Equations,
+ North-Holland Mathematics Studies 202, Elsevier, 2005.
+
+\bibitem{D-Rez} {K. Ulrich}, Oscillation and nonoscillation of
+ perturbered half-linear Euler differential equations,
+ Publ. Math. Debrecen {\bf 1} (2000).
+
+
+\end{thebibliography}
+
+
+\end{document}
+
diff --git a/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo2.pdf b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo2.pdf
new file mode 100644
index 0000000000..46f911f1a1
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo2.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo2.tex b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo2.tex
new file mode 100644
index 0000000000..a756a44090
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/fancy-preview-demo2.tex
@@ -0,0 +1,691 @@
+\documentclass{article}
+
+\let\rmdefault\sfdefault
+\def\modra#1{{\color{blue}\bm{#1}}}
+\def\cervena#1{{\color{red}\bm{#1}}}
+\def\separuj{\par\smallskip\hrule\kern 0.5pt\hrule \smallskip}
+\def\separujB{\par\hrule\kern 0.5pt\hrule}
+
+\newenvironment{block}{}{}
+\usepackage{amsfonts,amsmath,amsthm,url,bm}
+\usepackage{fancybox}
+\usepackage{mathpazo}
+\usepackage[latin2]{inputenc}
+\usepackage[IL2]{fontenc}
+
+
+\newtheorem{theorem}{Theorem}
+\newtheorem{corollary}{Corollary}
+\newtheorem{lemma}{Lemma}
+\newtheorem{Theorem}{Theorem}
+\def\theTheorem{\Alph{Theorem}}
+\theoremstyle{definition}
+\newtheorem{definition}{Definition}
+\newtheorem{remark}{Remark}
+
+\sloppy
+\everymath{\displaystyle}
+\usepackage[pdftex,nodirectory]{web}
+\def\titlepageTrailer{}
+\margins{.15in}{.15in}{12pt}{.15in} % left,right,top, bottom
+\screensize{4.5in}{6in} % web.sty dimensions
+
+\parindent 0 pt
+
+\usepackage{mdwlist}
+\usepackage{eso-pic}
+\definecolor{mygreen}{RGB}{120,190,20}
+\definecolor{mygreen}{RGB}{10,80,40}
+\definecolor{webgreen}{RGB}{10,80,40}
+\definecolor{seda}{gray}{0.31}
+\definecolor{webgreen}{RGB}{120,190,20}
+\AddToShipoutPicture{\hbox to 0 pt{\hbox to \paperwidth{\color{mygreen}\vrule
+width 0.5em height\paperheight\color{black}%\hskip -0.5 em
+\hskip 0 pt plus 1 fill
+\raise 1 pt\hbox {\normalfont\tiny \color{gray}\textbf{CDDEA 2010, Rajecké Teplice} (\thepage/12)}
+\hskip 0 pt plus 1 fill
+}}}%
+
+\def\qed{}
+
+\def\lambdamin{\lambda_{\text{\rm{min}}}}
+\def\lambdamax{\lambda_{\text{\rm{max}}}}
+
+\makeatletter\let\over\@@over\makeatother
+\def\theenumi{\roman{enumi}}
+\def\labelenumi{\textrm{\upshape{(\theenumi)}}}
+\def\konst{\textrm{const}}
+\def\div{\mathop{\hbox{\rm div}}}
+\def\meas{\mathop{\hbox{\rm meas}}}
+\def\sgn{\mathop{\hbox{\rm sgn}}}
+\def\laplac{\Delta}
+\def\R{\mathbb{R}}
+\def\N{\mathbb{N}}
+\def\dxi{\,\mathrm{d}\xi\,}
+\def\dx{\,\mathrm{d}x\,}
+\def\dS{\,\mathrm{d}\sigma\,}
+\def\dt{\,\mathrm{d}t\,}
+\def\dT{\,\mathrm{d}T\,}
+\def\du{\,\mathrm{d}u\,}
+\def\ds{\,\mathrm{d}s\,}
+\def\dr{\,\mathrm{d}r\,}
+\def\dphi{\,\mathrm{d}\phi\,}
+\newcommand{\duxi}{\frac{\partial u}{\partial x_i}}
+\newcommand{\derxi}{{\partial\over\partial x_i}}
+\newcommand{\pnorm}[1]{\|#1\|_p }
+\newcommand{\qnorm}[1]{\|#1\|_q }
+\newcommand\diver{\mathop{\rm div}}
+\let\hat\widehat
+\let\tilde\widetilde
+\let\~\tilde
+
+\let\phi\varphi
+
+\def\vyplnekA{\leaders\hrule height 0.8pt\hfill}
+\def\vyplnekB{\leaders\hrule height 6 pt depth -5.2pt\hfill}
+\def\nadpis#1\par{\medbreak \hbox to \hsize{{\color{mygreen}\vyplnekA\ {\textsc{#1}}\vyplnekB}}\par\medbreak}
+
+
+%\def\vec#1{\boldsymbol{#1}}
+\def\norm#1{\left\Vert#1\right\Vert}
+\def\x{\norm{x}}
+\def\w{\norm{\vec{w}}}
+\def\a{{\alpha}}
+\def\aa{{\alpha-1}}
+\def\at{{a\leq\x\leq t}}
+\def\o{\omega_n}
+\def\O{\Omega}
+\def\c{\cdot}
+\def\const{\hbox{const}}
+\def\eps{\varepsilon}
+\let\epsilon\varepsilon
+\interdisplaylinepenalty 50
+\setcounter{tocdepth}{1}
+
+\raggedbottom
+\let\rmdefault\sfdefault
+
+\usepackage{graphicx}
+\usepackage{multicol}
+
+\def\ss#1#2{\left\langle#1,#2\right\rangle}
+
+
+\makeatletter
+\renewcommand\maketitle
+{%
+ \thispagestyle{empty}%
+ \null\bigskip\bigskip
+ \ifeqforpaper\vspace*{2\baselineskip}%
+ \else
+ \vbox to\titleauthorproportion\textheight\bgroup%
+ \fi
+ \noindent\makebox[\linewidth]{\parbox{\linewidth}%
+ {\bfseries\color{\webuniversity@color}\ifeqforpaper\large\fi
+ \centering\webuniversity}}\par\ifeqforpaper\else\minimumskip\fi
+ \vspace{\stretch{1}}%
+ \noindent\makebox[\linewidth]{%
+ \parbox{\hproportionwebtitle\linewidth}%
+ {\bfseries\color{\webtitle@color}\ifeqforpaper\Large\else
+ \large\fi\centering\webtitle}}\par\ifeqforpaper
+ \vspace{2\baselineskip}\else\minimumskip\vspace{\stretch{1}}\fi
+ \noindent\makebox[\linewidth]{%
+ \parbox{\hproportionwebauthor\linewidth}%
+ {\bfseries\color{\webauthor@color}\ifeqforpaper
+ \large\fi\centering\webauthor}}
+ \ifeqforpaper\else
+ \egroup % end of \vbox for title and author
+ \fi\bigskip
+ \optionalpagematter
+ \par\vspace{\stretch{1}}
+ \ifx\web@directory@option y\webdirectory\fi
+ \par\ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}
+ \vfill\noindent\begingroup
+ \trailerFontSize\titlepageTrailer\par\endgroup
+ \newpage
+}
+
+\makeatother
+
+\pagestyle{empty}%
+
+%\usepackage[inactive]{fancytooltips}
+\begin{document}
+
+\def\TooltipRefmark{\hbox{\ \ }}
+\def\TooltipExtratext{\hbox{\ \ }}
+
+ \title{Conjugacy criteria for half-linear ODE \\in theory of PDE\\ with
+ generalized $p$-Laplacian\\ and mixed powers\\[15pt]}
+
+\author{Robert Ma\v r\'\i k\\[6mm]Dpt. of Mathematics\\ Mendel University\\Brno, CZ
+ }
+
+\date{}
+
+\maketitle
+
+\begin{equation}
+ \begin{aligned}
+ \div\left(A(x)\norm{\nabla y}^{p-2}\nabla y\right)&+ \ss{\vec
+ b(x)}{\norm{\nabla y}^{p-2}\nabla y}\\&+
+ c(x)|y|^{p-2}y+\sum_{i=1}^m c_i(x)|y|^{p_i-2}y=e(x),
+ \end{aligned}
+\tag{E}
+\end{equation}
+\begin{itemize}
+\item $x=(x_1,\ldots,x_n)_{i=1}^n\in\R^n$, $p>1$, $p_i>1$,
+\item $A(x)$ is elliptic $n\times n$ matrix with differentiable
+ components, $c(x)$ and $c_i(x)$ are H\"older continuous functions,
+ $\vec b(x)=\bigl(b_1(x),\ldots,b_n(x)\bigr)$ is continuous
+ $n$-vector function,
+\item $\nabla=\left({\partial \over\partial
+ x_1},\ldots,{\partial \over\partial
+ x_n}\right)_{i=1}^n$ and $\div={\partial \over\partial
+ x_1}+\cdots+{\partial \over\partial
+ x_n}$ is are the usual nabla and divergence operators,
+\item $q$ is a conjugate
+ number to the number $p$, i.e., $q=\frac p{p-1}$,
+\item $\ss{\cdot}{\cdot}$ is the usual scalar product in $\R^n$,
+ $\Vert{\cdot}\Vert$ is the usual norm in $\R^n$, $\Vert A\Vert
+ =\sup\left\{\Vert Ax\Vert: x\in \R^n \text{ with } \Vert x\Vert
+ =1\right\}=\lambdamax$ is the spectral norm
+\item \textbf{solution} of \eqref{eq:E} in $\Omega\subseteq \R^n$ is a
+differentiable function $u(x)$ such that $A(x)\Vert\nabla
+u(x)\Vert^{p-2}\nabla u(x)$ is also differentiable and $u$ satisfies
+\eqref{eq:E} in $\Omega$
+\item $ S(a)=\{x\in\R^n: \Vert x\Vert =a\}$, \\$
+ \Omega(a)=\{x\in\R^n:a\leq \Vert x\Vert \}$, \\$
+ \Omega(a,b)=\{x\in\R^n:a\leq\Vert x\Vert \leq b\}$
+\end{itemize}
+
+\newpage
+
+% \begin{equation}
+% {\shadowbox{$\div\Bigl(A(x)\Vert\nabla u\Vert^{p-2}\nabla u\Bigr) + \ss{\vec b(x)}{\Vert\nabla u\Vert^{p-2}\nabla u}+c(x)|u|^{p-2}u=0$}} \tag{E}
+% \end{equation}
+
+\nadpis {Concept of oscillation for ODE}
+
+\begin{equation}
+ u''+c(x)u=0 \label{eq1}
+\end{equation}
+
+\begin{itemize}
+\item Equation \eqref{eq1} is oscillatory if each solution has
+ infinitely many zeros in $[x_0,\infty)$.
+\item Equation \eqref{eq1} is oscillatory if each solution has a zero $[a,\infty)$
+ for each $a$.
+\item Equation \eqref{eq1} is oscillatory if each solution has
+ conjugate points on the interval $[a,\infty)$ for each $a$.
+\item All definition are equivalent (no accumulation of zeros and
+ Sturm separation theorem).
+\item Equation is oscillatory if $c(x)$ is large enough. Many
+ oscillation criteria are expressed in terms of the integral
+ $\int^\infty c(x)\dx$ (Hille and Nehari type)
+\item There are oscillation criteria which can detect oscillation even
+ if $\int^\infty c(x)\dx$ is extremly small. These criteria are in
+ fact series of conjugacy criteria.
+\end{itemize}
+
+\newpage
+\nadpis Equation with mixed powers
+
+\begin{equation}
+ \label{eq:Sun}
+ (p(t)u')'+c(t)u+\sum_{i=1}^m c_i(t)|u|^{\alpha _i}\sgn u=e(t)
+\end{equation}
+where $\alpha_1>\cdots >\alpha_m>1>\alpha_{m+1}>\cdots>\alpha_n>0$.
+\begin{Theorem}[Sun,Wong (2007)]
+\label{theorem:sun_wong}
+ If for any $T\geq 0$ there exists $a_1$, $b_1$, $a_2$, $b_2$ such
+ that $T\leq a_1<b_1\leq a_2<b_2$ and
+ \begin{equation*}
+ \begin{cases}
+ c_i(t)\geq 0& t\in[a_1,b_1]\cup[a_2,b_2],\ i=1,2,\dots,n\\
+ e(x)\leq 0& t\in[a_1,b_1]\\
+ e(x)\geq 0& t\in[a_2,b_2]
+ \end{cases}
+ \end{equation*}
+ and there exists a continuously differentiable function $u(t)$
+ satisfying $u(a_i)=u(b_i)=0$, $u(t)\neq 0$ on $(a_i,b_i)$ and
+ \begin{equation}\label{eq:SW}
+ \int_{a_i}^{b_i}\left\{p(t)u'^2(t)-Q(t)u^2(t)\right\}\dt\leq 0
+ \end{equation}
+ for $i=1,2$, where
+ \begin{equation*}
+ Q(t)=k_0|e(t)|^{\eta_0}\prod_{i=1}^m\Bigl(c_i^{\eta_i}(t)\Bigr)+c(t),
+ \end{equation*}
+ $k_0=\prod_{i=0}^m\eta_i^{-\eta_i}$ and $\eta_i$, $i=0,\dots,n$ are
+ positive constants satisfying
+% \begin{equation*}
+$ \sum_{i=1}^m\alpha_i\eta_i=1\quad\text{and}\quad \sum_{i=0}^m\eta_i=1$,
+% \end{equation*}
+ then all solutions of \eqref{eq:Sun} are oscillatory.
+\end{Theorem}
+
+
+
+\newpage
+\nadpis {Concept of oscillation for linear PDE}
+
+\begin{equation}
+ \Delta u+c(x)u=0 \label{eq2}
+\end{equation}
+
+\begin{itemize}
+\item Equation \eqref{eq2} is \textit{oscillatory} if every solution
+ has a zero on $\{x\in\R^n: \norm x\geq a\}$ for each $a$.
+\item Equation \eqref{eq2} is \textit{nodally oscillatory} if every
+ solution has a nodal domain on $\{x\in\R^n: \norm x\geq a\}$ for
+ each $a$.
+\item Both definition are equivalent (Moss+Piepenbrink).
+\end{itemize}
+
+
+\nadpis {Concept of oscillation for half-linear PDE}
+
+\begin{equation}
+ \div\Bigl(\norm{\nabla u}^{p-2}\nabla u\Bigr)+c(x)|u|^{p-2}u=0 \label{eq3}
+\end{equation}
+
+\begin{itemize}
+\item Essentialy the same approach to oscillation as in linear case
+\item The equivalence between two oscillations is open problem.
+\end{itemize}
+
+
+% \newpage
+% \nadpis Riccati substituion
+
+% If $u$ is a positive solution of the equation
+% \begin{equation}\label{eq:linODE}
+% u''+c(x)u=0,
+% \end{equation} then the function
+% $w=\frac{u'}{u}$ is a solution of the Riccati type differential equation
+% \begin{equation}
+% w'+c(x)+|w|^2=0.\label{eq:riceq}
+% \end{equation}
+
+
+% \textbf{Remark:} In fact
+% \begin{equation}
+% w'+c(x)+|w|^2\leq 0\label{eq:RICineq}
+% \end{equation}
+% is sufficient in proofs of nonexistence of positive (nonoscillatory)
+% solution \eqref{eq:linODE}, since solvability of \eqref{eq:RICineq}
+% implies solvability of \eqref{eq:riceq}.
+
+
+% \nadpis Transforming ODE result (nonexistence of positive solution)
+% into PDE
+
+% \null
+
+% \vskip -3\baselineskip
+
+% \null
+
+% % The method used to prove most of oscillation criteria for half-linear PDE
+% \begin{enumerate*}
+% \item Suppose by contradiction that the PDE possesses positive
+% (eventually positive) solution.
+% \item Using transformation
+% % \begin{equation*}
+% $ \vec w(x)=
+% \frac{\Vert \nabla u(x)\Vert ^{p-2}\nabla u(x)}{|u(x)|^{p-2}u(x)}
+% $
+% % \end{equation*}
+% convert positive solutions of
+% \begin{equation*}
+% \div\Bigl(\Vert\nabla u\Vert^{p-2}\nabla u\Bigr)+c(x)|u|^{p-2}u=0
+% \end{equation*}
+% into
+% \begin{equation}\label{5RIC}
+% \div \vec w+c(x) +(p-1)\ss{\vec w}{\frac{\nabla u(x)}{u(x)}}=0.
+% \end{equation}
+% \item Integrating \eqref{5RIC} over spheres and using standard tools
+% derive a Riccati type inequality of the form \eqref{eq:RICineq} and
+% proceed as in the ODE case.
+% \end{enumerate*}
+
+\newpage
+
+\null
+\kern-2\baselineskip
+
+\begin{equation}
+ \begin{aligned}
+ \div\left(A(x)\norm{\nabla y}^{p-2}\nabla y\right)&+ \ss{\vec
+ b(x)}{\norm{\nabla y}^{p-2}\nabla y}\\&+
+ c(x)|y|^{p-2}y+\sum_{i=1}^m c_i(x)|y|^{p_i-2}y=e(x),
+ \end{aligned}
+\tag{E}
+\end{equation}
+
+\nadpis Detection of oscillation from ODE
+
+% Oscillation of partial differential equation can be detected from
+% oscillation of ordinary differential equation.
+\begin{Theorem}[O. Do\v sl\'y (2001)] \label{rad}
+% Let
+% \begin{align*}
+% % \~a(r)={1\over \omega_nr^{n-1}}\int_{S(r)}a(x)\dS\\
+% \hat c(r)={1\over \omega_nr^{n-1}}\int_{S(r)}c(x)\dS.
+% \end{align*}
+Equation
+\begin{equation}
+\div(\Vert\nabla u\Vert^{p-2}\nabla u)+c(x)|u|^{p-2}u=0\label{eq:E-non-damp}
+\end{equation}
+is oscillatory, if the ordinary differential equation
+ \begin{equation}
+ \label{hl}
+ \Bigl( r^{n-1}|u'|^{p-2}u'\Bigr)'+r^{n-1}\left(\frac{1}{\omega_n r^{n-1}}\int_{S(r)}\, c(x) \,\dx\right)|u|^{p-2}u=0
+ \end{equation}
+is oscillatory.
+The number $\omega_n$ is the surface area of the unit sphere in $\R^n$.
+\end{Theorem}
+
+J. Jaro\v s, T. Kusano and N. Yoshida proved independently similar
+result (for $A(x)=a(\Vert x\Vert )I$, $a(\cdot)$ differentiable).
+
+\nadpis {Our aim}
+
+\begin{itemize*}
+\item Extend method used in Theorem \ref{theorem:sun_wong} to
+ \eqref{eq:E}. Derive a general result, like Theorem B.
+\item Derive a result which does depend on more general expression,
+ than the mean value of $c(x)$ over spheres centered in the origin.
+% Is it possible to detect oscillation in such an extreme case as
+% $\int_{S(||x||)}\modra{c(x)}\dS=0$?
+\item Remove restrictions used by previous authors (for example Xu (2009)
+ excluded the possibility $p_i>p$ for every $i$).
+ % S(r)}\cervena{\lambdamax(x)}}$ plays a crucial role in the linear
+ % case and $\boxed{\rho(r)\geq \max_{x\in S(r)}\cervena{\frac{\Vert
+ % {A(x)}\Vert ^p_F}{\lambdamin^{p-1}(x)}}}$ plays similar role
+ % if $p>1$. This phenomenon can be observed also in other
+ % oscillation criteria than Theorems B and C. We know that
+ % $\rho(r)\geq \lambda(r)$. Why such a discrepancy appears?
+\end{itemize*}
+
+\newpage
+\begin{equation}
+ \begin{aligned}
+ \div\left(A(x)\norm{\nabla y}^{p-2}\nabla y\right)&+ \ss{\vec
+ b(x)}{\norm{\nabla y}^{p-2}\nabla y}\\&+
+ \modra{c(x)|y|^{p-2}y}+\cervena{\sum_{i=1}^m c_i(x)|y|^{p_i-2}y}=\cervena{e(x)},
+ \end{aligned}
+\tag{E}
+\label{eq:E}
+\end{equation}
+
+\nadpis Modus operandi
+
+\begin{itemize}
+\item Get rid of terms $\sum_{i=1}^m c_i(x)|y|^{p_i-2}y$ and $e(x)$
+ (join with $c(x)|y|^{p-2}y$) and convert the problem into
+ \begin{equation*}
+ \div\left(A(x)\norm{\nabla y}^{p-2}\nabla y\right)+ \ss{\vec
+ b(x)}{\norm{\nabla y}^{p-2}\nabla y}+\modra{C(x)|y|^{p-2}y}=0.
+ \end{equation*}
+\item Derive Riccati type inequality in $n$ variables.
+\item Derive Riccati type inequality in $1$ variable.
+\item Use this inequality as a tool which transforms results from ODE
+ to PDE.
+\end{itemize}
+
+
+\newpage
+
+Using generalized AG inequality $\sum \alpha _i\geq
+\prod\left(\frac{\alpha_i}{\eta_i}\right)^{\eta_i}$, if $\alpha_i\geq
+0$, $\eta_i>0$ and $\sum \eta_i=1$ we eliminate the right-hand side and terms with mixed powers.
+
+
+
+\begin{lemma}\label{lemma:est1}
+ Let either $y>0$ and $e(x)\leq 0$ or $y<0$ and $e(x)\geq 0$. Let
+ $\eta_i>0$ be numbers satisfying $\sum_{i=0}^m{\eta_i}=1$ and
+ $\eta_0+\sum_{i=1}^m p_i\eta_i=p$ and let $c_i(x)\geq 0$ for every
+ $i$. Then
+ \begin{equation*}%\label{eq:est1}
+ \frac{1}{|y|^{p-2}y}\left(-e(x)+\sum_{i=1}^m c_i(x)|y|^{p_i-2} y\right)\geq C_1(x),
+ \end{equation*}
+ where
+ \begin{equation}
+ \label{eq:C1}
+ C_1(x):=\left|\frac{e(x)}{\eta_0}\right|^{\eta_0}
+ \prod_{i=1}^m\left(\frac{c_i(x)}{\eta_i}\right)^{\eta_i}.
+ \end{equation}
+\end{lemma}
+
+
+
+%\begin{remark}
+\textbf{Remark:} The numbers $\eta_i$ from Lemma \ref{lemma:est1} exist, if $p_i>p$ for some $i$.
+%\end{remark}
+
+% The following lemma is a modification of Lemma \ref{lemma:est1} in
+% the case $e(x)\equiv 0$.
+
+\begin{lemma}\label{lemma:est10}
+ Suppose $c_i(x)\geq 0$. Let $\eta_i>0$ be numbers satisfying
+ $\sum_{i=1}^m{\eta_i}=1$ and $\sum_{i=1}^m p_i\eta_i=p$. Then
+ \begin{equation*}%\label{eq:est10}
+ \frac{1}{|y|^{p-2}y}\sum_{i=1}^m c_i(x)|y|^{p_i-2}y\geq C_2(x),
+ \end{equation*}
+ where
+ \begin{equation}
+ \label{eq:C2}
+ C_2(x):=\prod_{i=1}^m\left(\frac{c_i(x)}{\eta_i}\right)^{\eta_i}
+ \end{equation}
+\end{lemma}
+
+% \begin{remark}
+\textbf{Remark:} The numbers $\eta_i$ from Lemma \ref{lemma:est10}
+exist iff $p_i>p$ for some $i$ and $p_j<p$ for some $j$.
+% \end{remark}
+
+
+\newpage
+% \begin{lemma}\label{lemma:ineq_cal}
+% The following inequalities hold for $a\geq 0$ and $x>0$.
+% \begin{enumerate}
+% \item If $\alpha<\beta$ and $b>0$, then $b-ax^\alpha\geq -x^\beta \left(\frac{a(\beta-\alpha)}{b\beta}\right)^{\frac\beta\alpha} \frac{b\alpha}{\beta-\alpha}$
+% \label{pa}
+% \item If $\alpha>\beta$ and $b\geq0$, then $ax^\alpha+b\geq x^\beta \left(\frac{a(\alpha-\beta)}{b\beta}\right)^{\frac\beta\alpha} \frac{b\alpha}{\alpha-\beta}$
+% \label{pb}
+% \end{enumerate}
+% \end{lemma}
+
+% Another possibility how to remove the right hand side and terms with
+% mixed powers is available if we rewrite
+% \begin{equation*}
+% \frac{1}{|y|^{p-2}y}\left(-e(x)+\sum_{i=1}^m c_i(x)|y|^{p_i-2}y\right)
+% \end{equation*}
+% into the form
+% \begin{equation*}
+% \sum_{i=1}^m \left(c_i(x)|y|^{p_i-p}-\frac{\epsilon_i e(x)}{|y|^{p-2}y} \right), \quad \epsilon_i>0, \quad \sum_{i=1}^m\epsilon_i=1
+% \end{equation*}
+% study the family of min/max problems
+% for terms in this sum.
+
+% \bigskip
+
+% \begin{lemma}\label{lemma:estimate2}
+% Let $e(x)<0$ and $y>0$. Then
+% \begin{equation*}%\label{eq:estimate2}
+% \sum_{i=1}^m c_i(x)|y|^{p_i-p}-\frac{e(x)}{|y|^{p-2}y}
+% \geq C_3(x),
+% \end{equation*}
+% where
+% \begin{multline}
+% \label{eq:C3}
+% C_3(x):=\sum_{i\in I_1}
+% \left(\left[\frac{[c_i(x)]_+(p_i-p)}{\epsilon_i|e(x)|(p-1)}\right]^{(p-1)/(p_i-1)}\frac{\epsilon_i|e(x)|(p_i-1)}{p_i-p}\right)\\
+% - \sum_{i\in I_2}\left(\left[\frac{[-c_i(x)]_+(p-p_i)}{\epsilon_i|e(x)|(p-1)}\right]^{(p-1)/(p_i-1)}\frac{\epsilon_i|e(x)|(p_i-1)}{p-p_i}\right),
+% \end{multline}
+% $I_1=\{i\in[1,m]\cap \N:p_i>p\}$ and $I_2=\{i\in[1,m]\cap \N:p_i<p\}$,
+% $\epsilon_i>0$, $\sum_{i=1}^m\epsilon_i=1$. Moreover, if
+% $I_2=\{\}$, then the inequality $e(x)<0$ can be relaxed to
+% $e(x)\leq 0$.
+% \end{lemma}
+
+
+
+% \newpage
+\begin{lemma}\label{lemma:cC}
+ Let $y$ be a solution of \eqref{eq:E} which does not have zero on
+ $\Omega$. Suppose that there exists a function
+ $C(x)$ such that
+ \begin{equation*}
+ C(x)\leq c(x)+\sum_{i=1}^m c_i(x)|y|^{p_i-p}-\frac{e(x)}{|y|^{p-2}y}
+% \label{ineq:C}
+ \end{equation*}
+ Denote $\vec w(x)=A(x)\frac{\norm{\nabla y}^{p-2}\nabla
+ y}{|y|^{p-2}y}$. The function $\vec w(x)$ is well defined on
+ $\Omega$ and satisfies the inequality
+ \begin{equation}
+ \label{eq:RIC}
+ \div \vec w+(p-1)\Lambda(x) \norm{\vec w}^q+\ss{\vec w}{A^{-1}(x)\vec b(x)}+C(x)\leq 0
+ \end{equation}
+ where
+ \begin{equation}\label{eq:Lambda}
+ \Lambda(x)=
+ \begin{cases}
+ \lambda_{{\max}}^{1-q}(x)& % \text{ for }
+ 1<p\leq 2,\\
+ \lambda_{{\min}}\lambda_{\max}^{-q}(x)& % \text{ for }
+ p>2.
+ \end{cases}
+ \end{equation}
+ \end{lemma}
+
+\begin{lemma}\label{lemma:alpha}
+ Let \eqref{eq:RIC} hold. Let $l>1$, $l^*=\frac{l}{l-1}$ be two
+ mutually conjugate numbers and $\alpha \in C^1(\Omega,\R^+)$ be
+ a smooth function positive on $\Omega$. Then
+ \begin{multline*}
+ % \label{eq:RIC2}
+ \div (\alpha(x)\vec w)+ (p-1)\frac {\Lambda(x)\alpha^{1-q}(x)}{l^*}
+ \norm{\alpha(x)\vec w}^q\\
+ -\frac{l^{p-1}\alpha(x)}{ p^p \Lambda^{p-1}(x)}\norm{A^{-1}(x)\vec b(x)-\frac{\nabla \alpha(x)}{\alpha(x)}}^p +\alpha(x)C(x)\leq 0
+ \end{multline*}
+ holds on $\Omega$. If $\norm{A^{-1}\vec b-\frac{\nabla
+ \alpha}\alpha}\equiv 0$ on $\Omega$, then this inequality holds
+ with $l^*=1$.
+\end{lemma}
+
+\newpage
+\begin{theorem}\label{lemma:radialODE}
+ Let the $n$-vector function $\vec w$ satisfy inequality
+ \begin{equation*}
+ \div \vec w+C_0(x)+(p-1)\Lambda_0(x)\norm{\vec w}^q\leq 0
+ \end{equation*}
+ on $\Omega(a,b)$. Denote $\tilde C(r)=\int_{S(r)}C_0(x)\dS$ and
+ $\tilde R(r)=\int_{S(r)}\Lambda_0^{1-p}\dS$. Then
+ the half-linear ordinary differential equation
+ \begin{equation*}%\label{eq:radialODE}
+ \left(\tilde R(r) |u'|^{p-2}u\right)'+\tilde C(r) |u|^{p-2}u=0,
+ \qquad {}'=\frac{\mathrm{d}}{\dr}
+ \end{equation*}
+ is disconjugate on $[a,b]$ and it possesses solution which has no
+ zero on $[a,b]$.
+\end{theorem}
+
+\begin{theorem}\label{th1}
+ Let $l>1$. Let $l^*={1}$ if $\norm{\vec b}\equiv 0$ and
+ $l^*=\frac{l}{l-1}$ otherwise. Further, let $c_i(x)\geq 0$ for every
+ $i$. Denote
+ \begin{equation*}%\label{eq:tildeR}
+ \tilde R(r)=(l^*)^{p-1}\int_{S(r)}\Lambda^{1-p}(x)\dS
+ \end{equation*}
+ and
+ \begin{equation*}
+ \tilde C(r)=\int_{S(r)}c(x)+C_1(x)-\frac{l^{p-1}}{ p^p \Lambda^{p-1}(x)}\norm{A^{-1}(x)\vec b(x)}^p\dS,
+ \end{equation*}
+ where $\Lambda(x)$ is defined by \eqref{eq:Lambda} and $C_1(x)$ is
+ defined by \eqref{eq:C1}.
+
+ Suppose that the equation
+ \begin{equation*}%\label{eq:th1}
+ \left(\tilde R(r)|u'|^{p-2}u'\right)'+\tilde C(r) |u|^{p-2}u=0
+ \end{equation*}
+ has conjugate points on $[a,b]$.
+
+ If $e(x)\leq 0$ on $\Omega(a,b)$, then equation \eqref{eq:E} has no
+ positive solution on $\Omega(a,b)$.
+
+ If $e(x)\geq 0$ on $\Omega(a,b)$, then equation \eqref{eq:E} has no
+ negative solution on $\Omega(a,b)$.
+\end{theorem}
+
+\begin{theorem}[non-radial variant of Theorem \ref{th1}]\label{th1a}
+ Let $l>1$ and let $\Omega\subset\Omega(a,b)$ be an open domain with
+ piecewise smooth boundary such that $\meas(\Omega \cap S(r))\neq 0$
+ for every $r\in[a,b]$. Let $c_i(x)\geq 0$ on $\Omega$ for every
+ $i$ and let $\alpha(x)$ be a function which is
+ positive and continuously differentiable on $\Omega$ and vanishes on
+ the boundary and outside $\Omega$. Let $l^*=1$ if $\norm{A^{-1}\vec
+ b-\frac{\nabla \alpha}{\alpha}}\equiv 0$ on $\Omega$ and
+ $l^*=\frac{l}{l-1}$ otherwise. In the former case suppose also that
+ the integral
+ \begin{equation*}
+ \int_{S(r)}\frac{\alpha(x)}{ \Lambda^{p-1}(x)}\norm{A^{-1}(x)\vec b(x)-\frac{\nabla\alpha(x)}{\alpha(x)}}^p\dS
+ \end{equation*}
+ which may have singularity on $\partial \Omega$ if
+ $\Omega\neq\Omega(a,b)$ is convergent for every $r\in[a,b]$. Denote
+ \begin{equation*}
+ \tilde R(r)=(l^*)^{p-1}\int_{S(r)}\alpha(x)\Lambda^{1-p}(x)\dS
+ \end{equation*}
+ and
+ \begin{equation*}
+ \tilde C(r)=\int_{S(r)}{\cervena{\alpha(x)}}\left(c(x)+C_1(x)-\frac{l^{p-1}}{ p^p \Lambda^{p-1}(x)}\norm{A^{-1}(x)\vec b(x)-\frac{\nabla\alpha(x)}{\alpha(x)}}^p\right)\dS,
+ \end{equation*}
+ where $\Lambda(x)$ is defined by \eqref{eq:Lambda} and $C_1(x)$ is
+ defined by \eqref{eq:C1} and suppose that equation
+ \begin{equation*}
+ \left(\tilde R(r)|u'|^{p-2}u'\right)'+\tilde C(r) |u|^{p-2}u=0
+ \end{equation*}
+ has conjugate points on $[a,b]$.
+
+ If $e(x)\leq 0$ on $\Omega(a,b)$, then equation \eqref{eq:E} has no
+ positive solution on $\Omega(a,b)$.
+
+ If $e(x)\geq 0$ on $\Omega(a,b)$, then equation \eqref{eq:E} has no
+ negative solution on $\Omega(a,b)$.
+\end{theorem}
+
+\newpage
+
+\begin{theorem}\label{th2}
+ Let $l$, $\Omega$, $\alpha(x)$, $\Lambda(x)$ and $\tilde R(r)$ be
+ defined as in Theorem \ref{th1a} and let $c_i(x)\geq 0$ and
+ \cervena{$e(x)\equiv 0$} on $\Omega(a,b)$. Denote
+ \begin{equation*}
+ \tilde C(r)=\int_{S(r)}\alpha(x)\left(c(x)+C_2(x)-\frac{l^{p-1}}{ p^p \Lambda^{p-1}(x)}\norm{A^{-1}(x)\vec b(x)-\frac{\nabla \alpha(x)}{\alpha(x)}}^p\right)\dS,
+ \end{equation*}
+ where $C_2(x)$ is defined by \eqref{eq:C2}.
+ If the equation %\eqref{eq:th1}
+ \begin{equation*}
+ \left(\tilde R(r)|u'|^{p-2}u'\right)'+\tilde C(r) |u|^{p-2}u=0
+ \end{equation*}
+ has conjugate points on $[a,b]$, then every solution of equation
+ \eqref{eq:E} has zero on $\Omega(a,b)$.
+\end{theorem}
+
+\bigskip\bigskip\bigskip
+{\rightskip 2cm
+\leftskip 2cm
+
+Similar theorems can be derived also for estimates of terms
+with mixed powers based on different methods than AG inequality % (for example
+% \eqref{eq:C3})
+(see R. M., Nonlinear Analysis TMA 73 (2010)).
+
+}
+
+\end{document}
+
+
+
diff --git a/macros/latex/contrib/fancytooltips/examples/fancytooltips-example.pdf b/macros/latex/contrib/fancytooltips/examples/fancytooltips-example.pdf
new file mode 100644
index 0000000000..8413b6fc27
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/fancytooltips-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/examples/fancytooltips-example.tex b/macros/latex/contrib/fancytooltips/examples/fancytooltips-example.tex
new file mode 100644
index 0000000000..292f6cbf3e
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/fancytooltips-example.tex
@@ -0,0 +1,55 @@
+\documentclass{article}
+
+\usepackage[pdftex,designiii]{web}
+
+\usepackage[filename=tooltipy,movetips,mouseover]{fancytooltips}
+
+\let\rmdefault\sfdefault
+
+\usepackage[shadein]{shadethm}
+
+\newshadetheorem{definition}{Definition}
+
+\usepackage{graphicx}
+
+\definecolor{bkg}{rgb}{1,0.9,0.9}
+\def\Message#1{\colorbox{bkg}{
+ \begin{minipage}{1\linewidth}
+ \smallskip
+ #1
+ \smallskip
+ \end{minipage}
+ }}
+\begin{document}
+
+
+\parindent 0 pt
+
+\Message{
+\begin{itemize}
+\item Use Acrobat Reader or Adobe Acrobat to view this file, please.
+\item The blue texts are covered by an active button. If you \textbf{move mouse over} one of
+ these buttons, tooltip appears. If you move your mouse out or if you
+ close the page, the tooltip disappears.
+\item The first links are tooltips, the fifth one is animated tooltip.
+\item The tooltips appears with the left down corner at the mouse
+ cursor, or at least as close as possible.
+\end{itemize}
+}
+
+\begin{definition}
+ This is definition of \tooltip{rank}{2}.
+\end{definition}
+
+
+\begin{definition}
+ This is \tooltip{definition}3 of \tooltip{derivative}{1}. Filler
+ text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text. Filler text.
+ \tooltip{derivative}{1}.
+\end{definition}
+
+
+This is a geometric \tooltipanim{idea}{4}{28} which is behind the
+definition of derivative.
+
+\end{document}
diff --git a/macros/latex/contrib/fancytooltips/examples/pics/tecna2.pdf b/macros/latex/contrib/fancytooltips/examples/pics/tecna2.pdf
new file mode 100644
index 0000000000..b4f69baa0f
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/pics/tecna2.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.pdf b/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.pdf
new file mode 100644
index 0000000000..ba14c364dc
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.tex b/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.tex
new file mode 100644
index 0000000000..3900839282
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.tex
@@ -0,0 +1,103 @@
+\documentclass{article}
+% \usepackage[czech]{babel}
+% \usepackage[IL2]{fontenc}
+
+\pagestyle{empty}
+\usepackage[createtips]{fancytooltips}
+
+\usepackage{fancybox}
+\parindent 0 pt
+
+\usepackage{color}
+\definecolor{gray}{rgb}{0.8, 0.8, 0.8}
+\definecolor{lightblue}{rgb}{0.7, 0.7, 1}
+\definecolor{lightgreen}{rgb}{0.7, 1, 0.7}
+
+\usepackage{multido,graphicx}
+\usepackage[papersize={5in,5in},margin=1pt]{geometry}
+\long\def\stranka#1#2{
+\setbox0=\hbox{\begin{minipage}{2in}
+\fboxsep 0 pt
+\color{red}
+\shadowbox{{\fboxsep 4pt\colorbox{yellow}
+ {\begin{minipage}{\linewidth}
+ \color{black}#2
+ \end{minipage}}}}
+\end{minipage}\ \ \ \ }
+\pdfpagewidth=\wd0
+\pdfpageheight=\ht0
+\advance \pdfpageheight by \dp0
+\copy0
+\keytip{#1}
+ \newpage
+}
+
+\long\def\strankaB#1#2{
+\setbox0=\hbox{\fboxsep 0 pt
+\color{red}
+\shadowbox{{\fboxsep 4pt\colorbox{yellow}
+ {\color{black}#2
+ }}}}
+\pdfpagewidth=\wd0
+\pdfpageheight=\ht0
+\advance \pdfpageheight by \dp0
+\copy0
+\keytip{#1}
+ \newpage
+}
+
+
+\def\definice#1{
+ \begin{center}
+ \colorbox{gray}{\begin{minipage}{0.9\linewidth} #1
+ \end{minipage}}
+ \end{center}
+}
+\def\vyuziti#1{
+ \begin{center}
+ \colorbox{lightblue}{\begin{minipage}{0.9\linewidth} #1
+ \end{minipage}}
+ \end{center}
+}
+\def\vypocet#1{
+ \begin{center}
+ \colorbox{lightgreen}{\begin{minipage}{0.9\linewidth} #1
+ \end{minipage}}
+ \end{center}
+}
+
+
+\begin{document}
+
+\stranka{derivace}{ \definice{The \textbf{derivative} is the limit
+ $$\lim_{h\to0}\frac{f(x+h)-f(x)}h,$$ if this limit exists as a finite number.} \vyuziti{ The derivative
+ has important applications in physics as a rate of change and as a
+ linear approximation.} \vypocet{The derivative can be evaluated
+ using appropriate formulas}}
+
+\stranka{hodnost}{ \definice{\textbf{Rank} is a maximal number of
+ linearly independent rows in a matrix.} \vyuziti{Rank can be used
+ to prove or disprove linear independence of vectors and it also
+ appears in the Frobenius Theorem.} \vypocet{To find the rank of a
+ matrix, you have to convert this matrix into row echelon form.}}
+
+\strankaB{definition}{???}
+
+\pdfpageheight=0pt
+
+\pdfpagewidth=0pt
+
+\def\obrazek#1{%
+\setbox0=\hbox{\color{red}%
+ \fboxsep 0 pt{\shadowbox{{\color{black}\includegraphics[width=3.5in,
+ page=#1,viewport= 0 57 350 230,clip]{tecna2.pdf}}}}}
+\pdfpagewidth=\wd0
+\pdfpageheight=\ht0
+\advance \pdfpageheight by \dp0
+\copy0
+\newpage}
+
+
+\multido{\i=1+1}{25}{\obrazek{\i}}
+
+\end{document}
diff --git a/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.tips b/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.tips
new file mode 100644
index 0000000000..d0f37ddb0e
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/pics/tooltipy.tips
@@ -0,0 +1,3 @@
+\tooltipname{derivace}{1}
+\tooltipname{hodnost}{2}
+\tooltipname{definition}{3}
diff --git a/macros/latex/contrib/fancytooltips/examples/readme b/macros/latex/contrib/fancytooltips/examples/readme
new file mode 100644
index 0000000000..7054e948d6
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/examples/readme
@@ -0,0 +1,5 @@
+Compile the examples as follows
+
+pdflatex fancytooltips-example.tex (2 times)
+fancy-preview fancy-preview-demo --tooltips=pics/tooltipy --fancy_options=preview
+fancy-preview fancy-preview-demo2 \ No newline at end of file
diff --git a/macros/latex/contrib/fancytooltips/fancy-preview b/macros/latex/contrib/fancytooltips/fancy-preview
new file mode 100644
index 0000000000..bbfb340920
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancy-preview
@@ -0,0 +1,448 @@
+#!/usr/bin/env perl
+#
+# Copyright (C) 2012 by Robert Marik <marik@mendelu.cz>
+# ------------------------------------------------------
+#
+# This file may be distributed and/or modified under the conditions of
+# the LaTeX Project Public License, either version 1.2 of this license
+# or (at your option) any later version. The latest version of this
+# license is in:
+#
+# http://www.latex-project.org/lppl.txt
+#
+# and version 1.2 or later is part of all distributions of LaTeX
+# version 1999/12/01 or later.
+#
+# fancy-preview
+# -------------
+#
+# This 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
+# http://tex.stackexchange.com/questions/15356/showing-the-bibliographic-entry-in-a-popup-when-you-hover-over-the-citation-key
+# for some discussion and papers
+# http://permalink.gmane.org/gmane.comp.tex.pdftex/3898 and
+# http://www.math.huji.ac.il/~erezla/papers/continuity_semisimple.pdf
+# as demos of interactive PDF.
+#
+# Demos for the current script are at
+# http://user.mendelu.cz/marik/fancy-preview site. Basicaly, you can
+# find there PDF files with hyperref links. Each link is followed by a
+# button. This button is invisible in mathematical papers and blue
+# soap in presentations.
+#
+# 1. add "\usepackage{hyperref}" to the preamble of your document (say
+# filename.tex),
+#
+# 2. add blank line after each \bibitem command,
+#
+# 3. compile with command "bash fancy-preview filename" i.e. no tex
+# extension is used in the command line
+#
+# 4. You may customize this script.
+#
+# The script has been tested on Linux, Ubuntu 12.04,TeXlive 2011.
+#
+# It works as follows:
+# 1. We extract desired environments in two runs. We crop the PDF
+# files and save the information relatex labels from aux file.
+# 2. We join the files together, we add some background and graphics
+# to the tooltips.
+#
+#
+# Known bugs, limitations.
+# ------------------------
+#
+# * Do not use tags involving \ref command, do not use something like
+# \tag{\ref{someting}-b} inside equation environment.
+# * Do not use the word tocindent in the labels.
+# * Do not use elsart class. Use for example article or elsarticle
+# class.
+# * Each bibitem must be finished by a blank line.
+#
+#
+# History
+# -------
+#
+# June 12, 2012: advanced posibilities for configuration
+# May 24, 2012: bash script converted to Perl for better portability, tests on MS Windows.
+# May 7, 2012: initial Linux version in bash
+#
+use strict;
+use Getopt::Long;
+
+my $filename = $ARGV[0];
+my $filename_noext = $filename;
+$filename_noext =~ s/\.tex//;
+my $aux_file=$filename_noext.".aux";
+my @tempfilenames=($filename_noext.".aux");
+my %latex =();
+
+# Setting for two passes of preview.sty
+$latex{'a'}='\makeatletter\def\nononotags{\def\@eqnnum{\relax}\def\tagform@##1{}}\makeatother\AtBeginDocument{\usepackage[pdftex,active,tightpage,displaymath]{preview}\nononotags}';
+$latex{'b'}='\AtEndDocument{\clearpage}\AtBeginDocument{\usepackage[pdftex,active,tightpage]{preview}\setlength\PreviewBorder{5pt}}';
+
+# Do not use third pass of preview.sty by default
+$latex{'c'}='';
+$latex{'a_extra'}='';
+$latex{'b_extra'}='';
+$latex{'pass_order'}="acb";
+
+# Hacks to get references (in the first pass).
+# IMPORTANT: each bibitem must be finished by a blank line.
+$latex{'preview_bibitem'}='\AtBeginDocument{\newenvironment{fakebibitem}{\begin{minipage}{0.75\textwidth}}{\end{minipage}}\PreviewEnvironment{fakebibitem}\renewcommand\bibitem[2][]{\BIBITEM {#2}}\def\BIBITEM#1#2\par{\begin{fakebibitem} #2 \label{fancy:cite:#1}\end{fakebibitem}}}';
+$latex{'preview_biblatex'}='\AtBeginDocument{\PreviewEnvironment{fakebibitem}\def\fancycitation#1{\begin{fakebibitem}\setbox0=\hbox{\parbox{0.75\textwidth}{\fullcite{#1}\label{fancy:cite:#1}}}\pdfpagewidth=\wd0\pdfpageheight=\ht0\advance\pdfpageheight by \dp0\copy0\end{fakebibitem}\newpage}}\AtEndDocument{\input '.$filename_noext.'-fancybib.tmp}';
+
+# The environments for extraction in the second pass of preview.sty.
+$latex{'environments'}="Theorem,theorem,lemma,corollary,definition";
+$latex{'snarfenvironments'}="figure";
+
+# The variable with initial commands for all pdflatex calls.
+$latex{'ini'}='\relax';
+my $pdflatex="pdflatex";
+my $bibtex="bibtex";
+my $pdfcrop="pdfcrop";
+
+# Default options for final compilation with fancytooltips. Change
+# "previewall" into "preview" to omit tooltips with target on the same
+# page (useful for presentations). You may also set this option from
+# the comand line.
+my $fancy_options="previewall,nosoap";
+my $tooltipfile="";
+my $help=0;
+my $version=0;
+my $date="24.6.2012";
+my $versionnumber="0.2";
+
+# The code used in premable. Should define macro \tooltipwraper which
+# inserts the tooltip extracted in previous compilations into a box
+# with nontransparent background
+$latex{'tooltips_envelope_preamble'}='\usepackage{xcolor,tikz}\usetikzlibrary{shadows}\def\tooltipwraper#1{\begin{tikzpicture}\node[drop shadow,fill=yellow!30,draw=black!30, rounded corners=3pt,very thick]{#1};\end{tikzpicture}}';
+
+
+$latex{'biblatex'}='
+% from http://tex.stackexchange.com/questions/15356/showing-the-bibliographic-entry-in-a-popup-when-you-hover-over-the-citation-key/54831#54831
+% thanks to Audrey
+
+% Apply tooltip to "extratext" area just after inline citation links
+\DeclareFieldFormat{bibhyperref}{%
+ \tooltip*{\bibhyperref{#1}}{fancy:cite:\thefield{entrykey}}}
+
+% Define new citation commands that replace citation links with tooltips
+\DeclareFieldFormat{bibtooltip}{\tooltip{#1}{fancy:cite:\thefield{entrykey}}}
+\newrobustcmd*{\tooltiphook}{%
+ \AtNextCite{\DeclareFieldAlias{bibhyperref}{bibtooltip}}}
+\newrobustcmd*{\tooltipcite}{\tooltiphook\cite}
+\newrobustcmd*{\tooltipcites}{\tooltiphook\cites}
+
+% Apply tooltip to instance where numeric-comp uses \bibhyperref instead
+% of bibhyperref format
+\makeatletter
+\newbibmacro*{cite:dump:tooltip}{%
+ \ifnumgreater{\value{cbx@tempcnta}}{0}
+ {\ifnumgreater{\value{cbx@tempcnta}}{1}
+ {\bibrangedash}
+ {\multicitedelim}%
+ \tooltip*
+ {\bibhyperref[\cbx@lastkey]{%
+ \ifdef\cbx@lastprefix
+ {\printtext[prefixnumber]{\cbx@lastprefix}}
+ {}%
+ \printtext[labelnumber]{\cbx@lastnumber}}}
+ {fancy:cite:\cbx@lastkey}}
+ {}%
+ \setcounter{cbx@tempcnta}{0}%
+ \global\undef\cbx@lastprefix}
+\ifcsundef{abx@macro@\detokenize{cite:dump}}
+ {}{\renewbibmacro*{cite:dump}{\usebibmacro{cite:dump:tooltip}}}
+\makeatother
+';
+
+my %options=();
+GetOptions (
+"fancy_options=s" => \$options{fancy_options},
+"pdfcrop=s" => \$options{pdfcrop},
+"tooltips=s" => \$options{tooltips},
+"ini_file=s" => \$options{ini_file},
+"version" => \$version,
+"help" => \$help);
+
+if ($version)
+{
+ print "$versionnumber\n";
+ exit();
+}
+
+if ($help)
+{
+ my $help_text='
+This is fancy-preview script (R. Marik, http://user.mendelu.cz/marik)
+============================
+
+The script converts LaTeX files into PDF files. The references are
+followed by invisible buttons whih allow to show the target in a popup
+window.
+
+The homepage (last version, documentation, tips for users, examples)
+of the script is http://user.mendelu.cz/marik/fancy-preview
+
+OPTIONS:
+
+For detailed description see Section 3 of the manual to the
+fancytooltips package.
+
+ --fancy_options="text" text is passed as optional parameter to
+ fancytooltips package
+
+ --pdfcrop="filename" program to crop the boundaries of PDF file
+
+ --tooltips="filename" the file filename.pdf contains hand-created
+ tooltips and filename.tips optionally
+ keywords to acces these tooltips
+
+ --ini_file="filename" ini file with the configuration
+
+ --version prints version and exists
+
+ --help prints help and exists
+
+EXAMPLES:
+Compile file.tex
+
+ perl fancy-preview file
+
+Compile file.tex, use pdfcrop2 to crop the boundary of PDF file, show
+only previews where the target is on the different page
+
+ ./fancy-preview file --fancy_options="preview" --pdfcrop="pdfcrop2"
+
+';
+ print $help_text;
+ exit();
+}
+
+
+#### Read configuration from ~/.fancy-preview.ini and ./fancy-preview.ini
+use Config::IniFiles;
+my($cfg);
+
+sub set_tex_variable
+{
+ if ($cfg->exists( 'latex', $_[0] )) {$latex{$_[0]}=$cfg->val( 'latex', $_[0]);}
+}
+
+sub read_config
+{
+ if ( -e $_[0])
+ {
+ $cfg = Config::IniFiles->new( -file => $_[0]);
+ if ($cfg->exists( 'main', 'pdfcrop' )) {$pdfcrop=$cfg->val( 'main', 'pdfcrop');}
+ if ($cfg->exists( 'main', 'fancy_options' )) {$fancy_options=$cfg->val( 'main', 'fancy_options');}
+ if ($cfg->exists( 'main', 'tooltips' )) {$tooltipfile=$cfg->val( 'main', 'tooltips');}
+ my @options=("tooltips_envelope_preamble","environments","snarfenvironments","a","a_extra","b","b_extra","c","ini","biblatex","pass_order");
+ foreach my $current_option (@options) {set_tex_variable($current_option);}
+ }
+}
+
+if ($options{ini_file})
+{
+ read_config($options{ini_file});
+}
+else
+{
+ read_config($ENV{"HOME"}."/.fancy-preview.ini");
+ read_config("./fancy-preview.ini");
+}
+#### end of configuration
+
+# command line overrides config file
+if ($options{fancy_options}) {$fancy_options=$options{fancy_options}};
+if ($options{pdfcrop}) {$pdfcrop=$options{pdfcrop}};
+if ($options{tooltips}) {$tooltipfile=$options{tooltips}};
+
+my $biblatex=0;
+
+# -----------------------------------------------------------------
+# We extract stuff from the TeX file, extract the label definition
+# from aux file and crop the PDF file. Since pdfcrop from texlive
+# creates large files, we allow customization (see
+# http://tex.stackexchange.com/questions/42236/pdfcrop-generates-larger-file
+# )
+
+unlink ("$filename_noext.aux");
+
+# The first compilation to create numbers for equations, theorems, figures, ...
+system("$pdflatex \"$latex{ini} \\input $filename\"");
+
+
+# We test if the file uses biblatex. If not, thebibliography is supposed.
+open(LOG, $filename_noext.".log");
+my @log_data=<LOG>;
+my @log_tmp = grep /^Package: biblatex/, @log_data;
+my $log_tmp_size=@log_tmp;
+if ($log_tmp_size>0) {$biblatex=1;}
+
+my $preview_references="";
+if ($biblatex)
+{
+ optbibtex();
+ open(AUX, $aux_file);
+ my @aux_data=<AUX>;
+ my @result=();
+ foreach $a (@aux_data)
+ {
+ if (($a =~ m/\\citation{/)&&($a !~ m/{biblatex-control}/))
+ {
+ $a =~ s/\\citation{/\\fancycitation{/;
+ push(@result, $a);
+ }
+ }
+ close(AUX);
+
+ sub uniq {
+ return keys %{{ map { $_ => 1 } @_ }};
+ }
+
+ open(AUXA, ">$filename_noext"."-fancybib.tmp");
+ foreach $a (sort(uniq(@result)))
+ {
+ print AUXA $a;
+ }
+ close(AUXA);
+ push (@tempfilenames,$filename_noext."-fancybib.tmp");
+ $preview_references=$latex{'preview_biblatex'};
+}
+else
+{
+ $preview_references=$latex{'preview_bibitem'};
+}
+
+system("$pdflatex \"$latex{ini}\\relax $latex{a}\\relax $latex{'a_extra'}\\relax $preview_references\\relax \\input $filename\"");
+parse_aux_file_and_crop("a");
+
+# The second pass, in this pass theorem-like environments are
+# extracted. Two passes are necessary, since numbered equations which
+# appear in theorems frequently have to been extracted separately (in
+# the first pass).
+
+if($latex{'environments'} ne "")
+{
+$latex{'b'}=$latex{'b'}.'\AtBeginDocument{\PreviewEnvironment[{[]}]{'.join('}\PreviewEnvironment[{[]}]{',split(/,/,$latex{'environments'}))."}}";
+}
+if($latex{'snarfenvironments'} ne "")
+{
+$latex{'b'}=$latex{'b'}.'\AtBeginDocument{\PreviewSnarfEnvironment[{[]}]{'.join('}\PreviewSnarfEnvironment[{[]}]{',split(/,/,$latex{'snarfenvironments'}))."}}";
+}
+$latex{'b'}=$latex{'b'}.$latex{'b_extra'};
+compile_parse_aux_file_and_crop("b");
+
+if($latex{'c'} ne "")
+{
+ compile_parse_aux_file_and_crop("c");
+}
+else
+{
+ $latex{'pass_order'} =~ s/c//;
+}
+
+print "\n----------------------------------------------\n------ pdflatex genearting tooltips ----------\n----------------------------------------------";
+
+# We merge all the tooltips in one file. If some hand created
+# tooltips are also present, we insert these tooltips first in a loop
+# (multido). Then we insert theorem-like environments (from the second
+# pass) and finaly equations and citations (from the first pass).
+
+my $opt_pdfpages_a="";
+my $opt_pdfpages_b="";
+my $inserttooltips='\insertttp{'.join('}\insertttp{',split(//,$latex{'pass_order'})).'}';
+
+if ($tooltipfile ne "")
+{
+ $opt_pdfpages_a='\usepackage{multido}';
+ $opt_pdfpages_b='\ifx\pdfpagewrapper\undefined\let\pdfpagewrapper\relax\fi\pdfximage{'.$tooltipfile.'.pdf}\edef\FancyPreviewTotalPages{\the\pdflastximagepages}\multido{\i=1+1}{\FancyPreviewTotalPages}{\setbox0=\hbox{\pdfpagewrapper{\includegraphics[page=\i]{'.$tooltipfile.'.pdf}}}\pdfpagewidth=\wd0 \pdfpageheight=\ht0 \advance \pdfpageheight by \dp0 \copy0\newpage}\newpage';
+}
+
+system("$pdflatex".' "\documentclass{minimal}\usepackage{graphicx}'.$opt_pdfpages_a.'\usepackage[papersize={5in,5in},margin=1pt]{geometry}'.$latex{'tooltips_envelope_preamble'}.'\usepackage[createtips]{fancytooltips}\newdimen\dist \dist=5pt\relax\begin{document}\pagestyle{empty}'.$opt_pdfpages_b.'\relax \gdef\savemaplabels#1#2#3#4{\xdef\temp{#2}} \def\fancypreviewnewlabel#1#2{\savemaplabels#2 \expandafter\ifx\csname keytip:#1:used\endcsname\relax \expandafter\def\csname keytip:#1:used\endcsname{used}\setbox0=\vbox{\kern\dist\hbox{\kern\dist\tooltipwraper{\includegraphics[page=\temp]{'.$filename_noext.'-\ttpfilename-crop.pdf}}\kern\dist}\kern\dist}\pdfpagewidth=\wd0 \pdfpageheight=\ht0 \advance \pdfpageheight by \dp0 \copy0 \keytip{#1}\newpage\fi}\def\insertttp#1{\def\ttpfilename{#1}\input '.$filename_noext.'-#1.tmp}'.$inserttooltips.'\end{document}"');
+
+if ($tooltipfile ne "")
+{
+open(TIPS1, ">>minimal.tips");
+open(TIPS2, "$tooltipfile.tips");
+while (<TIPS2>) { print TIPS1 $_; }
+close (TIPS1);
+close (TIPS2);
+}
+
+# If biblatex is used, we update the information in bib file and hack
+# the cite-like commands according to the example
+# http://tex.stackexchange.com/questions/15356/showing-the-bibliographic-entry-in-a-popup-when-you-hover-over-the-citation-key/54831#54831
+#
+
+$latex{'ini'}="";
+if ($biblatex)
+{
+ system("$pdflatex \"$latex{'ini'}\\relax \\input $filename\"");
+ system("$bibtex $filename_noext.aux");
+
+ open(BIBL, ">fancy-preview-biblatex-settings.tex");
+ print BIBL $latex{'biblatex'};
+ close (BIBL);
+ push (@tempfilenames,"fancy-preview-biblatex-settings.tex");
+ $latex{'ini'}='\AtBeginDocument{\input fancy-preview-biblatex-settings.tex}';
+}
+
+for my $i (1 .. 4){
+ my $hypersetup='\hypersetup{colorlinks=true}';
+ print "----------------------------------------------\n------ pdflatex final compilation $i ----------\n----------------------------------------------\n";
+ system("$pdflatex -jobname=$filename_noext \"$latex{'ini'}".'\RequirePackage{etoolbox}\PassOptionsToPackage{active,mouseover,movetips,filename=minimal,'.$fancy_options.'}{fancytooltips}\AtEndPreamble{\usepackage{fancytooltips}'.$hypersetup.'}\input '.$filename.'"')
+}
+
+foreach my $deletefile (@tempfilenames) {unlink ($deletefile);}
+
+print "\n ---------------------------------------------\n fancy-preview with options \"$fancy_options\" on \"$filename\" finished \n The output is in $filename_noext.pdf \n\n If the pdf file is too large, consider pdfcrop option\n and http://tex.stackexchange.com/questions/42236/pdfcrop-generates-larger-file\n ---------------------------------------------\n\n";
+
+
+sub parse_aux_file_and_crop
+{
+ # opens aux file, finds lines starting with \newlabel and not involving tocindent and writes them into tmp file
+ open(AUX, $aux_file);
+ my @aux_data=<AUX>;
+ my @filtered_data_tmp = grep /^\\newlabel/, @aux_data;
+ my @filtered_data = grep !/tocindent/, @filtered_data_tmp;
+ my $aux_file_a=$filename_noext."-".@_[0].".tmp";
+ open(AUXA, ">$aux_file_a");
+ foreach my $aa (@filtered_data)
+ {
+ $aa =~ s/\\newlabel{/\\fancypreviewnewlabel{/;
+ print AUXA $aa;
+ }
+ close (AUXA);
+ close (AUX);
+ push(@tempfilenames,$aux_file_a);
+ # crops the file
+ print "\nCropping PDF file, this may take some time ...\n";
+ system("$pdfcrop $filename_noext.pdf $filename_noext-@_[0]-crop.pdf");
+ push(@tempfilenames,"$filename_noext-@_[0]-crop.pdf");
+}
+
+
+sub compile_parse_aux_file_and_crop
+{
+ unlink ("$filename_noext.aux");
+ system("$pdflatex \"$latex{ini} \\input $filename\"");
+ optbibtex();
+ system("$pdflatex \"$latex{ini} $latex{$_[0]} \\input $filename\"");
+ parse_aux_file_and_crop($_[0]);
+}
+
+
+sub optbibtex
+{
+ # runs bibtex and pdflatex if biblatex has been detected ($biblatex variable is 1)
+ if ($biblatex)
+ {
+ system("$bibtex $filename_noext.aux");
+ system("$pdflatex \"$latex{ini} \\input $filename\"");
+ }
+}
diff --git a/macros/latex/contrib/fancytooltips/fancytipmark.eps b/macros/latex/contrib/fancytooltips/fancytipmark.eps
new file mode 100644
index 0000000000..e5f246e0bf
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytipmark.eps
@@ -0,0 +1,37 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: inkscape 0.46
+%%Pages: 1
+%%Orientation: Portrait
+%%BoundingBox: 0 0 169 151
+%%HiResBoundingBox: 0 0 169 151
+%%EndComments
+%%Page: 1 1
+0 151 translate
+0.8 -0.8 scale
+0 0 0 setrgbcolor
+[] 0 setdash
+1 setlinewidth
+0 setlinejoin
+0 setlinecap
+gsave [1 0 0 1 0 0] concat
+gsave [1 0 0 1 -40.05603 -249.7852] concat
+gsave [1 0 0 1 40.05603 249.7852] concat
+gsave
+0.68235296 0.99215686 0.99215686 setrgbcolor
+newpath
+109.59375 0 moveto
+53.91441 0 8.7500002 32.958799 8.75 73.5625 curveto
+8.75 100.6214 28.819291 124.25609 58.6875 137.03125 curveto
+46.718756 180.50775 0 185.71875 0 185.71875 curveto
+9.6194678e-14 185.71875 80.353988 202.74436 139 143.9375 curveto
+180.35547 134.75429 210.46876 106.71062 210.46875 73.5625 curveto
+210.40625 70.9375 lineto
+208.47805 31.274736 164.01697 -6.2537662e-13 109.59375 0 curveto
+closepath
+fill
+grestore
+grestore
+grestore
+grestore
+showpage
+%%EOF
diff --git a/macros/latex/contrib/fancytooltips/fancytipmark.pdf b/macros/latex/contrib/fancytooltips/fancytipmark.pdf
new file mode 100644
index 0000000000..6bc49497e4
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytipmark.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/fancytipmark.svg b/macros/latex/contrib/fancytooltips/fancytipmark.svg
new file mode 100644
index 0000000000..304789b7d4
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytipmark.svg
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="210.47626"
+ height="188.0038"
+ id="svg2"
+ inkscape:label="PozadĂ­"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ version="1.0"
+ sodipodi:docbase="/home/marik/livetooltips"
+ sodipodi:docname="fancytipmark.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs3">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 94.0019 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="210.47626 : 94.0019 : 1"
+ inkscape:persp3d-origin="105.23813 : 62.667933 : 1"
+ id="perspective9" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.3730769"
+ inkscape:cx="4.1486356"
+ inkscape:cy="73.050093"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="926"
+ inkscape:window-height="730"
+ inkscape:window-x="6"
+ inkscape:window-y="55"
+ showgrid="false" />
+ <metadata
+ id="metadata6">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Vrstva 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-40.05603,-249.7852)">
+ <path
+ style="fill:#aefdfd;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:3, 3;stroke-dashoffset:0;opacity:1"
+ d="M 109.59375 0 C 53.91441 0 8.7500002 32.958799 8.75 73.5625 C 8.75 100.6214 28.819291 124.25609 58.6875 137.03125 C 46.718756 180.50775 0 185.71875 0 185.71875 C 9.6194678e-14 185.71875 80.353988 202.74436 139 143.9375 C 180.35547 134.75429 210.46876 106.71062 210.46875 73.5625 L 210.40625 70.9375 C 208.47805 31.274736 164.01697 -6.2537662e-13 109.59375 0 z "
+ transform="translate(40.05603,249.7852)"
+ id="path1871" />
+ </g>
+</svg>
diff --git a/macros/latex/contrib/fancytooltips/fancytipmark1.pdf b/macros/latex/contrib/fancytooltips/fancytipmark1.pdf
new file mode 100644
index 0000000000..0418679f77
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytipmark1.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/fancytipmark2.pdf b/macros/latex/contrib/fancytooltips/fancytipmark2.pdf
new file mode 100644
index 0000000000..2a4cc733e2
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytipmark2.pdf
@@ -0,0 +1,67 @@
+%PDF-1.5
+%µí®ű
+3 0 obj
+<< /Length 4 0 R
+ /Filter /FlateDecode
+>>
+stream
+xśeP˝N1 Üý÷;¶W–JH eE ¨HE…ׯ} ~”!>çîěË™„-†ăń~Äő“ŕřA‚yîw¨\đ™đ–ŻôđdÁ35Üá ]¬«yio\ÍĄNäÁ#'´ÎÚG–ÁR*Šs¶!ěS°A/Ü"©ťĹ HEąÉ@s3¨*ŹŇ“]k8´Ťő^–X»p·ö@żcp•€ŽĆ=M3`™ćĆÚ<ůÓu1$8ă@MÖ4r[›áďÝW#«îloií)Ěđ–ˇ5TĎüŰźĐÔĽüüˇěiOk^O€
+endstream
+endobj
+4 0 obj
+ 229
+endobj
+2 0 obj
+<<
+ /ExtGState <<
+ /a0 << /CA 1 /ca 1 >>
+ >>
+>>
+endobj
+5 0 obj
+<< /Type /Page
+ /Parent 1 0 R
+ /MediaBox [ 0 0 172.400452 154.378052 ]
+ /Contents 3 0 R
+ /Group <<
+ /Type /Group
+ /S /Transparency
+ /CS /DeviceRGB
+ >>
+ /Resources 2 0 R
+>>
+endobj
+1 0 obj
+<< /Type /Pages
+ /Kids [ 5 0 R ]
+ /Count 1
+>>
+endobj
+6 0 obj
+<< /Creator (cairo 1.10.2 (http://cairographics.org))
+ /Producer (cairo 1.10.2 (http://cairographics.org))
+>>
+endobj
+7 0 obj
+<< /Type /Catalog
+ /Pages 1 0 R
+>>
+endobj
+xref
+0 8
+0000000000 65535 f
+0000000629 00000 n
+0000000343 00000 n
+0000000015 00000 n
+0000000321 00000 n
+0000000415 00000 n
+0000000694 00000 n
+0000000821 00000 n
+trailer
+<< /Size 8
+ /Root 7 0 R
+ /Info 6 0 R
+>>
+startxref
+873
+%%EOF
diff --git a/macros/latex/contrib/fancytooltips/fancytipmark3.pdf b/macros/latex/contrib/fancytooltips/fancytipmark3.pdf
new file mode 100644
index 0000000000..259db35737
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytipmark3.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/fancytipmark4.pdf b/macros/latex/contrib/fancytooltips/fancytipmark4.pdf
new file mode 100644
index 0000000000..2710ec863d
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytipmark4.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/fancytooltips.dtx b/macros/latex/contrib/fancytooltips/fancytooltips.dtx
new file mode 100644
index 0000000000..5685590a47
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytooltips.dtx
@@ -0,0 +1,1415 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2004-2012 by Robert Marik <marik@mendelu.cz>
+% ----------------------------------------------------------
+%
+% This file may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.2
+% of this license or (at your option) any later version.
+% The latest version of this license is in:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.2 or later is part of all distributions of LaTeX
+% version 1999/12/01 or later.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{fancytooltips.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{fancytooltips}
+%<*package>
+ [2012/06/12 v1.12 fancytooltips.dtx file]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\OnlyDescription
+\usepackage{xcolor,graphicx,listings}
+\usepackage[filename=tip,mouseover,movetips,fg]{fancytooltips}
+\buttontipwidth=2cm
+\buttontipheight=2cm
+\begin{document}
+\color{black}
+ \DocInput{fancytooltips.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{1186}
+%
+% \CharacterTable {Upper-case
+% \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z Lower-case
+% \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z Digits
+% \0\1\2\3\4\5\6\7\8\9 Exclamation \! Double quote \" Hash (number)
+% \# Dollar \$ Percent \% Ampersand \& Acute accent \' Left paren \(
+% Right paren \) Asterisk \* Plus \+ Comma \, Minus \- Point \.
+% Solidus \/ Colon \: Semicolon \; Less than \< Equals \= Greater than
+% \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_ Grave accent \` Left
+% brace \{ Vertical bar \| Right brace \} Tilde \~}
+%
+%
+% \changes{v1.0}{2007/02/15}{Initial version}
+%
+% \changes{v1.1}{2007/02/20}{Clener code, better documentation, fix
+% for bug with delayinterval macro, support for dvips and Distiller
+% users.}
+%
+% \changes{v1.2}{2007/03/01}{Better support for dvips users, buttons
+% for icons are created automatically using eso-pic package and have
+% the name "ikona.pagenumber", new option \texttt{movetips}, tooltip
+% appears on the current page only and, as a consequence, animations
+% are faster.}
+%
+% \changes{v1.3}{2007/05/08}{Fixed bug which appears in dvips route.
+% Improved documentation -- added a note about the required version
+% of eforms.sty}
+%
+% \changes{v1.4}{2009/04/29}{Added support for presentations (like
+% \texttt{pause} command for texpower).}
+%
+% \changes{v1.5}{2009/05/05}{Handling number of pages via aux file
+% (fixes some problems issued by previous modification and page
+% break near tooltip).}
+%
+% \changes{v1.6}{2010/04/10}{Added options \texttt{debug},
+% \texttt{active} and \texttt{inactive}, added an example with
+% automatic previews for equations and floats. Added handling of
+% this.dirty and app.focusRect. Changed the name of the file with
+% tooltips. Added starred version of \texttt{tooltip} command.}
+%
+% \changes{v1.7}{2010/05/20}{Added options \texttt{blur} and
+% \texttt{fg}, cleaned some command names}
+%
+% \changes{v1.8}{2010/06/10}{Added hook do insert stuff on each page.}
+%
+% \changes{v1.9}{2011/12/04}{Changed expansion in the new |\ref|
+% command provided by |FancyHook| macro (see |fancy-preview|
+% facility).}
+%
+% \changes{v1.10}{2012/05/09}{New script preview-latex. New options
+% |previewall| and |nosoap|.}
+%
+% \changes{v1.11}{2012/05/11}{Fixed bug related to bad position if
+% |fg| option is used and \texttt{evensidemargin} is different from
+% \texttt{oddsidemargin}.}
+%
+% \changes{v1.12}{2012/06/12}{Documentation updated. New option
+% |tooltipmark|.}
+%
+% \GetFileInfo{fancytooltips.dtx}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+%
+%
+% \title{The \textsf{fancytooltips} package, the \textsf{fancy-preview} script\thanks{This document
+% corresponds to \textsf{fancytooltips}~\fileversion, dated
+% \filedate.} \thanks{Supported by grants 18/2006, 99/2008 and 131/2010
+% of Higher
+% Education Development Fund (FRV\v S) }} \author{Robert Ma\v r\'\i k \\
+% \texttt{marik@mendelu.cz}}
+%
+% \maketitle
+%
+% \setcounter{tocdepth}{2}\tableofcontents\rightskip=0em plus 0.2em\sloppy
+% \section{Introduction}
+%
+% The \LaTeX{} package |fancytooltips| allows to insert tooltips into
+% PDF documents -- a popup windows appears if the mouse hovers or
+% clicks particular area. You can use plain text as well as
+% mathematics, pictures and animations in your tooltips. The PDF
+% viewer must interpret Javascripts to make the tooltips work. This is
+% currently true only for (free) Abobe Reader and (commercial) Adobe
+% Acrobat. There are two ways how to produce the PDF file. The
+% simplest way is to use |pdflatex|. Another option is |latex| +
+% |dvips| + AdobeDistiller\footnote{not free |ps2pdf|} + Adobe
+% Acrobat\footnote{not free Adobe Reader.}.
+%
+% \color{black}Here you can test two tooltips: \tooltip{Einstein's
+% formula}{1} and simple \tooltipanim{animation}{2}{7} (numbers from 1
+% to 6). For more examples how the presentation may look like see the
+% |examples| subdirectory. We also provide a Perl script
+% |fancy-preview| which allows to extract equations, theorems and
+% related parts of text into separate PDF file and insert tooltips
+% after each |\ref|, |\eqref| and |\cite| command automatically. For
+% more information see Figure \ref{fig:1} and demos (scientific
+% papers, presentations, tests) at
+% \url{http://user.mendelu.cz/marik/fancy-preview}.
+%
+% Related \LaTeX{} packages are |cooltooltips|, |pdfcomment| (smaller
+% size of the resulting PDF, but restricted to plain text), |ocgtools|
+% (works with layers, only |pdflatex| is supported) and Acro\TeX{}
+% (works with layers, only |latex| + |dvips| + Adobe Distiller + Adobe
+% Acrobat are supported). All these ``similar'' packages allow to
+% write the text for the tooltips inside the main document. In
+% contrast to this approach, |fancytooltips| package makes use of an
+% external file. This allow to use graphics or mathematical
+% expressions in the tooltips.
+%
+% The package requires |eforms.sty| and |insdljs.sty| packages, which
+% are part of AcroTeX bundle
+% (\url{http://www.math.uakron.edu/~dpstory/webeq.html}).
+%
+% \section{Usage of \texttt{fancytooltips.sty}}
+% \subsection{Small technical background}
+%
+% \begin{itemize}
+% \item The pages from the external PDF file with tootlips are
+% inserted as icons at hidden buttons into the resulting
+% PDF.
+% \item If you insert tooltip, the current page is covered by an
+% invisible transparent button which spans across the whole page
+% (the information about the pages with tooltips is stored in |aux|
+% file and hence we have to run \LaTeX{} \textit{three times}). The
+% button has an associated JavaScript action to close all tooltips
+% (i.e. make itself and other related buttons hidden).
+% \item Another button which reveals tooltip is created. This button
+% is transparent, covers the text typeset by \TeX{} and allows to
+% activate a JavaScript. This JavaScript takes the picture required,
+% puts this picture as icon to the button which covers the
+% corresponding page and makes this button visible.
+% \item Each page has an associated action which closes all tooltips
+% when the page is opened.
+% \end{itemize}
+%
+% \subsection{The file with tooltips}
+% The file with tooltips is an ordinary PDF file, one tooltip per
+% page. Tooltips should be in the top right corner at the page, in a
+% \textit{box with nontransparent background} and the rest of the page
+% should be transparent. If you consider to use |movetips| option
+% which causes the tooltip appear near the mouse cursor instead of in
+% the top right corner (see below), then every page should have the
+% dimensions equal to the dimensions of the colored box with
+% tooltip\footnote{Look at the files \texttt{tooltipy.tex} and
+% \texttt{tooltipy.pdf} from |examples| subdirectory for a simple
+% example how to meet this condition under pdf\LaTeX. You may also use
+% ordinary \LaTeX{} class, set \texttt{\textbackslash pagestyle\{empty\}} and crop the boundary.}. You can
+% call the tooltips by their page numbers, but for better comfort we
+% also provide simple cross referencing mechanism. If the pdf file is
+% created by \LaTeX, \DescribeMacro{\keytip} you can define keywords
+% to refer to the pages using |\keytip| command. Simply put
+% |\usepackage[createtips]{fancytooltips}| into preamble and write
+% \texttt{\string\keytip}\marg{foo} in document. This writes
+% information about keyword \meta{foo} and the pagenumber into file
+% |\jobname.tips|. See
+% \url{http://user.mendelu.cz/marik/fancytooltips} for some tooltip
+% templates.
+%
+% \subsection{The file with presentation}
+% In the file with presentation, the user is responsible to
+% \begin{itemize}
+% \item input either |color| or |xcolor| package in the
+% preamble
+% \item \LaTeX{} the file two times (we write some macros into |aux|
+% file) or three times (if option |fg| is used).
+% \end{itemize}
+% You may use the following options to set the necessary information
+% and change the default behavior of the package.
+%
+% \def\iitem#1{\item[{\color{blue!50!black}\texttt{#1}}]}
+% \begin{description}\sloppy\rightskip 0 pt plus 1 em
+% \iitem{filename} To input the tooltips from file \meta{foo.pdf}
+% call the package with |filename| option:
+% |\usepackage[filename=foo]{fancytooltips}|. This option is
+% required if compiled with |pdflatex|.
+%
+% \iitem{movetips} By default, tooltip appears in the
+% top right corner of the page (use View--PageLayout-Single Page in
+% your Adobe Reader, please). If the option |movetips| is used, then
+% tooltip appears close to the mouse pointer. More precisely, tooltip
+% appears with left down corner at the mouse position, if there is
+% enough place. If not, tooltip appears with right down corner at the
+% mouse position. Finally, the tooltip is shifted down to fit the
+% page, if necessary\footnote{This option works in this way if every
+% page of the file with tooltips has dimensions of the box with
+% tooltip. See the \texttt{examples} subdirectory.}.
+%
+%
+% \iitem{mouseover} If you use |mouseover| option,
+% then tooltip appears if you move the mouse pointer to the active
+% area (no clicking is necessary).
+%
+% \iitem{inactive} This option makes the package
+% inactive.
+%
+% \iitem{active} This option forces the package
+% active even if |inactive| option is loaded.
+%
+% \iitem{blur} The rest of the page is blurred, when showing
+% tooltip. Use either |\usepackage[blur]{fancytooltips}| or
+% |\usepackage[blur=number]{fancytooltips}|, where |number| is
+% a number between 0 and 1. (Note that we use transparent package
+% and hence this could have an influence on the colors of the
+% document and could make your PDF less portable.) This option is
+% allowed in pdf\LaTeX{} mode only. If this options brakes colors
+% only on the page which include tooltips, you may want to use
+% option |fixcolor| to fix it.
+%
+% \iitem{fixcolor} See |blur| option.
+%
+% \iitem{debug} Prints two alerts reporting success or problems when
+% opening PDF file in Adobe Acrobat (Adobe Reader). Use this option
+% to find possible source of problems. See also the Section
+% \ref{sec:tr} in this manual.
+%
+% \iitem{noextratext} No mark is appended at the end of the link
+% which opens tooltips (see help for |\tooltip|).
+%
+% \iitem{nosoap} A single space is used to occupy the space for
+% button produced by |\tooltip*| command instead of blue soap. As a
+% result, the button produced by |\tooltip*| works as usual, but it
+% is invisible. This is sometimes convenient for the user, since the
+% mark does not disturb the text. However, the author has to
+% instruct the user, that the hidden buttons follow links from
+% cross references.
+%
+% \iitem {fg} The button for displaying pictures is placed on
+% background and the buttons which activate tooltips are placed
+% immediately in the text by default. With |fg| option all these
+% buttons are placed into foreground after the page is completed. We
+% use |\pdfsavepos| command and keep track of the position for
+% buttons in aux file and hence this option works in pdf\LaTeX\ only
+% and the file needs more compilations. This option does not do
+% anything in dvi mode now (despite the fact that pdf\LaTeX\
+% provides the feature also for dvi mode), but this could be changed
+% if someone requests this feature. Use this option for example, if
+% you use frame around hyperlinks or buttons and form fields in your
+% PDF (like tests produced by Acro\TeX).
+%
+% \iitem{preview} Redefines |\ref|, |\eqref| and |\cite| commands to
+% work with tooltips extracted by |fancy-preview|, see Section
+% \ref{sec:fancy-preview} and demo files in |example/fancy-preview|
+% directory. The tooltip is inserted only if the target of the
+% reference is on different PDF page as the tooltip. This option is
+% suitable for presentations where the whole PDF page is
+% visible. Replaces former |\FancyHook| command.
+%
+% \iitem{previewall} Like |preview| but shows tooltip also if the
+% target is on the same page. Suitable for enhanced versions of
+% papers written on A4 page.
+%
+% \def\aaa#1{#1\hbox
+% {\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+% {fancytipmark#1.pdf}}}}} \iitem{tooltipmark} Allows to change the
+% tooltipmark to some predefined styles, values are \aaa1, \aaa2,
+% \aaa3 and \aaa4. Note that you can change the mark to whatever
+% different by redefining |\TooltipExtratext| command. Work only in
+% pdflatex mode.
+%
+% \end{description}
+%
+% \DescribeMacro{\tooltip} The user can put the tooltip into her or
+% his presentation using the command
+% \texttt{\string\tooltip}{\marg{stuff}\marg{keyword-or-pagenumber}}
+% where \meta{stuff} is the printed text in \meta{tooltipcolor} color
+% and \meta{keyword-or-pagenumber} is either the pagenumber of the
+% tooltip in the external file or the keyword defined by |\keytip|
+% command and stored in |\TooltipFilename.tips| file, where
+% |\TooltipFilename| is set automatically from the |filename| option.
+% \DescribeMacro{\TooltipExtratext} The printed text \meta{stuff} is
+% followed by |\TooltipExtratext| command. The default value is small
+% blue soap, as you have seen in the second paragraph of this
+% documentation. There is a |noextratext| option which defines
+% |\TooltipExtratext| to be empty. \DescribeMacro{noextratext option}
+% If \marg{keyword-or-pagenumber} is not recognized as valid keyword
+% for tooltips, it is supposed to be pagenumber.
+%
+% The text \marg{stuff} is inserted in |\hbox| by
+% |\tooltip|. \DescribeMacro{\tooltip*}With starred version of the
+% |\tooltip| macro the text \marg{stuff} is not inserted into the box
+% and the active button dos not cover the text \marg{stuff}, but
+% covers the mark produced by |\TooltipExtratext|.
+%
+% \DescribeMacro{\tooltipanim}\DescribeMacro{\tooltipanim*} The user
+% can put a series (animation) of tooltips into the presentation by
+% using \texttt{\string\tooltipanim}\marg{stuff}\marg{start}\marg{end}
+% command, where \meta{start} and \meta{end} are keywords defined by
+% |\keytip| command or page numbers. \DescribeMacro{\delayinterval}
+% The delay between two frames is |\delayinterval| milliseconds. The
+% default value is 200, you can change it by command
+% |\def\delayinterval{100}|. There is also starred version which works
+% similarly like |\tooltip*| command.
+%
+% \DescribeMacro{\TooltipRefmark} Extra text added to |\ref|, |\eqref|
+% and |\cite| commands with previews, see Section
+% \ref{sec:fancy-preview}. The default value is the same as for
+% |\TooltipExtratext|.
+%
+% \subsubsection{Changes for dvips users}
+% Dvips users also have to prepare tooltips into PDF file, not eps as
+% usual. But we have to insert these tooltips in Adobe Acrobat Pro
+% program. If you use Acrobat Pro version 8.1 and later, install the
+% file \texttt{aeb.js} from AcroTeX eDucation bundle as described in
+% the documentation to AcroTeX.\footnote{If you do not install
+% \texttt{aeb.js} properly, you can still create your presentation,
+% but you have to import the |fdf| file manually, see the section
+% Troubleshooting and known problems.}
+%
+% Since \LaTeX{} is not capable to find the number of pages in
+% external PDF file with tooltips, \DescribeMacro{dvips}dvips users have to specify option
+% |dvips| in |fancytooltips| package. \DescribeMacro{pages} You have
+% to use also a |pages| option with the number of pages in the PDF
+% file with tooltips, if you use dvips route. You have to call the
+% package by
+% something like this:\\
+% |\usepackage[dvips,filename=tooltipy,pages=27]{fancytooltips}|
+%
+% You have to |latex| (two times) and |dvips| your file first. This
+% produces |filename.ps| and |Tooltipsdljs.fdf| files. Distill the
+% |filename.ps| file into |filename.pdf| and open this file by Adobe
+% Acrobat Professional -- this imports macros from |Tooltipsdljs.fdf|
+% file. In Acrobat's JavaScript console (open by |Crtl+J|) run (using
+% |Ctrl+Enter|) the command |ImportTooltips();| which is defined for
+% the document. This command inserts invisible buttons on the first
+% page, imports icons (the file with icons specified as
+% \meta{filename} parameter when loading fancytooltips must be in
+% working directory). You should see a message ``\texttt{importing
+% pictures}'' and the command returns 1 when finished. Then
+% \textbf{save the file} (you can use the same name). If the command
+% |ImportTooltips();| fails, you either have not the PDF file with
+% tooltips in current directory, or the PDF file does not contain
+% JavaScripts. In the latter case insert document level JavaScripts
+% manually as described in the Section \ref{sec:tr}.
+%
+% \section{Tootlips at
+% references: \texttt{fancy-preview}} \label{sec:fancy-preview}
+% \subsection{Basic usage}
+% There is a Perl script |fancy-preview| which can be used to extract
+% text from bibliography items, numbered equations, numbered theorems,
+% lemmas, etc, put this text into separate PDF file and add this text
+% as tooltips to the corresponding |\ref|, |\eqref| and |\cite|
+% commands. Reading the resulting file may look like on Figure
+% \ref{fig:1}.
+% \begin{figure}
+% \centering
+%\fbox{\includegraphics[width=0.95\textwidth]{cite.png}}
+% \caption{\texttt{fancy-preview}}
+% \label{fig:1}
+% \end{figure}
+%
+%
+% The script |fancy-preview| has been tested with Texlive2011 on both
+% Linux and MS Windows. To run this script you need working Perl
+% installation (usually present on Linux workstations, on MS Windows
+% you may need to install Perl from
+% \url{http://www.activestate.com/activeperl}) and |Config::IniFiles|
+% module\footnote{Package |libconfig-inifiles-perl| on Ubuntu Linux,
+% |cpan Config::IniFiles| or |ppm install Config::Inifiles| on MS
+% Windows. Alternatively you can run |ppm| without any parameters to
+% invoke the GUI.})
+%
+% To compile your document |file.tex| do the following
+% \begin{itemize}
+% \item Put |\usepackage{hyperref}| into the preamble of your document
+% (if not already loaded).
+% \item If you write references in |thebibliography| environment, put
+% empty line after each |\bibitem| command (including the last item
+% in |thebibliography|).
+% \item Run |fancy-preview file|. After several compilations you
+% should get the PDF file |file.pdf|.
+% \end{itemize}
+% The default work-flow is the following. The file is compiled with
+% |pdflatex| to get correct numbers of equations and in the first
+% pass of |preview.sty| we extract displayed equations (but the
+% numbers are thrown away). After this we crop the PDF file by using
+% |pdfcrop| program (an alternate program can be specified as
+% optional parameter). Then we extract numbered environments
+% (theorem, Theorem, lemma, corollary, definition, figure, table)
+% using the second pass and crop the PDF file again. After this we
+% merge all equations, theorems etc which are marked with |\label|
+% command. The PDF file with extracted parts of the text is the used
+% as source of toltips in final compilations.
+%
+% Many things can be customized. The following options are
+% available.
+% \begin{description}
+% \iitem{pdfcrop} You may specify an alternative batch file to crop
+% boundary of PDF file. Default is |pdfcrop|. The command line for
+% an alternative program to crop PDF file is supposed to be the
+% following: |programname input.pdf output.pdf|. Using optimal
+% program to PDF file may be much fasater and may produce
+% significantly smaller files. \iitem{tooltips} You may combine
+% the tooltips extracted by |fancy-preview| with ``ordinary hand
+% made tooltips''. Simply call |fancytooltips| in the main document
+% by |\usepackage[inactive]{fancytooltips}| in your document and
+% specify the file with tooltips in the command line of the
+% |fancy-preview| or in the |ini| file. You may also compile your
+% file by |pdflatex| and get ``normal'' PDF output (the compilation
+% is way faster). \iitem{fancy\underline{ }options} Options passed
+% |fancytooltips| in final compilations. Default is
+% |previewall,nosoap|. Options |mouseover| and |movetips| are added
+% automaticaly.\iitem{ini\underline{ }file}Specifices the |ini| file
+% with configuration, see the next subsection.
+% \end{description}
+% \subsection{Configuration from ini files}
+% Other customization can be done via |ini| files. The script looks
+% for customizations in the file specified by |ini_file| command line
+% parameter. If this parameterer is not used, the script looks for
+% customization in two default locations: |~/.fancy-preview.ini| and
+% in |./fancy-preview.ini| (both files are used if both exist). You
+% can use |~/.fancy-preview.ini| for customizations related to all
+% your projects and |./fancy-preview.ini| for projects in the current
+% directory. The options from the file
+% |./fancy-preview.ini| override |~/.fancy-preview.ini| and the
+% options from command line override options from
+% |./fancy-preview.ini|. The format is described at
+% \url{http://search.cpan.org/~shlomif/Config-IniFiles-2.75/lib/Config/IniFiles.pm}.
+%
+% The parameters are divided into two sections, |[main]| and |[latex]|.
+% In section |[main]| of |ini| file you can set parameters |pdfcrop|,
+% |tooltips| and |fancy_options|.
+%
+% In the section |[latex]| if the initialization file you can
+% customize the compilation by \LaTeX. Here you can set parameters
+% |environments| and |snarfenvironments| to set the environments which
+% will be extracted. The default values are
+% |environments=Theorem,theorem,lemma,corollary,definition| and
+% |snarfenvironments=figure|.
+%
+% The material from |tex| file is extracted in three passes. These
+% passes are denoted by |a|, |b| and |c|. If
+% \texttt{\string\label}\marg{foo} appears in the text which is marked
+% for extraction, then the corresponding
+% \texttt{\string\newlabel}\marg{foo} command is written to the |aux|
+% file and \meta{foo} is supposed to be the name of the keyword
+% corresponding to the PDF page with the text.
+%
+% If a referenced material appears in more passes, then the priority
+% is set in the variable |$latex{'pass_order'}| and can be customized
+% in the ini file in |[latex]| section as |pass_order| parameter. The
+% default value is |pass_order=acb|, i.e. |c| overrides |b| and |a|
+% overrides |c|.
+%
+% As a typical example consider equation with label |\label{eq}| in
+% numbered theorem with label |\label{th}|. The equation is extracted
+% in pass |a| (displayed equation) and in pass |b| (the whole
+% theorem). The corresponding |\newlabel{eq}| command appers in two
+% |aux| files -- from passes |a| and |b|. The first one corresponds to
+% the PDF page with equation, the latter to the PDF page with whole
+% theorem. Since |a| overrides |b|, then |\ref{eq}| and |\eqref{eq}|
+% commands show the number of the equation followed by the tooltip
+% with equation only. Further |\ref{th}| shows number of the theorem
+% followed by the tooltip with the whole theorem. If you set |pass_order=ba|, then both |\ref{eq}| and |\ref{th}| are followed by the
+% same tooltip.
+%
+% The following options are available\footnote{These
+% options are used as keywords in a hash variable \texttt{latex}, i.e. for
+% default value of \texttt{param} parameter search the file \texttt{fancy-preview}
+% for \texttt{\$latex\{'param'\}}.}.
+%\begin{itemize}
+% \iitem {a} Defines commands for the first pass. It
+% inserts |preview.sty| command which extracts displayed
+% mathematics. Also resets |\tagform@| and |\@eqnnum| to skip
+% printing of equation numbers.
+% \iitem {a\underline{ }extra} Defines material which is appended to |a|
+%
+% \iitem {b} Defines commands fot the second pass. In this \LaTeX{}
+% run are (by default) floating figures and theorem-like environments
+% extracted. Inserts |preview.sty|. At the runtime,
+% |\PreviewEnvironment[{[]}]{env}| and
+% |\PreviewSnarfEnvironment[{[]}]{env}| for each |env| in comma
+% separated list from |environments| and |snafenvironments| is added,
+% respectively.
+% \iitem {b\underline{ }extra} Defines material which is appended to |b|
+%
+% \iitem{environments} See |b| option.
+%
+% \iitem{snarfenvironments} See |b| option. Default value is |figure|.
+%
+% \iitem {c} If empty (default value), then the third pass is
+% skipped. Otherwise, you may activate |preview.sty| similarly like in
+% |b| (for a template see the source code and the default setting of
+% |$latex{'b'}|) and extract environments and commands according to
+% your interest. A possible application is to extract |minipage|
+% environments, if there are two or more figures inserted in
+% |minipage| environments into one |figure| environment.
+%
+% \iitem{pass\underline{ }order} Sets priority, which pass is supposed
+% to produce the output for a |\label| which is extracted more times
+% than once, see the previous paragraphs for explanation and example.
+%
+% \iitem{preview\underline{ }bibitem} Redefines |\bibtem| command. The
+% material between |\bibitem| and |\par| is wrapped to the width of
+% |0.75\textwidth| and extracted.
+%
+% \iitem{preview\underline{ }biblatex} Similarly like
+% |preview_bibitem| but works with |biblatex|.
+%
+% \iitem{ini} Inserted at the begin of each |pdflatex| run.
+%
+% \iitem{tooltips\underline{ }envelope\underline{ }preamble} Used in
+% preamble. Defines command |\tooltipwraper|. This command wraps the
+% tooltips. Default is to use |tikz| to put everything into a yellow
+% box with rounded corners and shading.
+%
+% \iitem{biblatex} Creates temporary file
+% |fancy-preview-biblatex-settings.tex|. This file contains definition
+% which allow |biblatex| to work with citations and tooltips and we
+% input this file in final compilations. This code comes from
+% |tex.stackexchange.com|.
+%\end{itemize}
+%
+%
+%
+% \subsection{Tips and tricks}
+% \begin{itemize}
+% \item The program |pdfcrop| from \TeX live may produces large PDF
+% files. See the discussion at
+% \url{http://tex.stackexchange.com}\footnote{\url{http://tex.stackexchange.com/questions/42236/pdfcrop-generates-larger-file}}. The
+% smaller size can be obtained with the solution from the discussion
+% below the question, which is based on |gs| and |pdftk|. The
+% |python| script from the same discussion produces slightly larger
+% file than |pdftk|, but still much smaller than |pdfcrop| and
+% provides the fastest solution.
+% \item Do not use floats in environments, which are
+% extracted. Otherwise you get an error from \LaTeX. A workaround
+% could be also to change temporarily definition of the floating
+% environment (redefine |figure| environment, for example).
+% \item If you are not interested in customization via |ini| files and
+% do not want to install extra modules to your Perl installation,
+% you may delete the about twenty lines from |fancy-preview|
+% starting with |use Config::IniFiles;| up to the line
+% |read_config("./fancy-preview.ini");|
+% \end{itemize}
+%
+% \section{Troubleshooting and known problems}\label{sec:tr}
+% The source code is in Mercurial repository at
+% \url{http://bitbucket.org/robert.marik/fancytooltips/}. You can also
+% report problems and issues in the forum at this site. The code on
+% |bitbucket.org| is considered as development version and repository
+% for older versions. The last stable version is always the version
+% from CTAN.
+% \begin{itemize}
+% \item
+% The package works with |eforms.sty| from version
+% 2006/10/03 v1.0a. You can download this or newer version from
+% \url{http://www.acrotex.net} site.
+% \item If the graphics included by |\TooltipExtratext| and
+% |\TooltipRefmark| has colors with \textbf{custom opacity}, Adobe
+% Acrobat Pro sometimes renders the pictures bad. No problems of
+% this type have been observed with free Adobe Reader.
+% \item For \textbf{dvips} users: In some cases the file
+% |Tooltipsdljs.fdf| is \textbf{not imported automatically}
+% (probably some setting in Adobe Acrobat or new versions of
+% |eforms.sty| and |insdljs.sty|). In this case you do not see any
+% message when using |debug| option. You have troubles of this type
+% if you see in the Javascript console (Ctrl+J) error messages like
+% ``\texttt{aebTrustedFunctions is not defined 3:Page:Open
+% CloseTooltips is not defined 1:Page:Open}''. In this case you
+% have to import the file |Tooltipsdljs.fdf| \textbf{manually from
+% ``Form'' menu} in Adobe Acrobat Pro. Then go to the JavaScript
+% console and run |ImportTooltips();| command.
+% \end{itemize}
+%
+% Follow the points below if you want to find the source of your
+% problems.
+% \begin{itemize}
+% \item For dvips users it is a good idea to check that Acro\TeX{} is
+% properly installed. Do the demo files from Acro\TeX{} work for you?
+% \item Try to use |debug| option, prepare the PDF file and open it in
+% Adobe Acrobat or Adobe Reader.
+% \begin{itemize}
+% \item You should see two messages when opening the file. If not,
+% the Javascript do not work in your document (are not inserted
+% properly).
+% \item Both messages should report success for pdflatex users. For
+% dvips users one of the message should report error and if you
+% run |ImportTooltips();| command in Javascript console, you should
+% see a message in Javascript console which confirms that the
+% pictures from external PDF file have been imported. If you save
+% the PDF file and open again, both messages should report
+% success.
+% \end{itemize}
+% \end{itemize}
+%
+% \PrintChanges
+% \StopEventually{}
+%
+% \section{Implementation}
+% \begin{macrocode}
+%<*package>
+\RequirePackage{graphicx}
+\RequirePackage{xkeyval}
+\RequirePackage{atbegshi}
+
+\newif\if@fancytooltips@createtips\@fancytooltips@createtipsfalse
+\DeclareOptionX{createtips}{\@fancytooltips@createtipstrue}
+
+\newif\ifTooltip@usepdftex\Tooltip@usepdftextrue
+\DeclareOptionX{dvips}{\Tooltip@usepdftexfalse}
+
+\newif\if@fancytooltips@extratext\@fancytooltips@extratexttrue
+\DeclareOptionX{noextratext}{\@fancytooltips@extratextfalse}
+
+\newif\if@fancytooltips@movetips\@fancytooltips@movetipsfalse
+\DeclareOptionX{movetips}{\@fancytooltips@movetipstrue}
+
+\newif\if@fancytooltips@mouseover\@fancytooltips@mouseoverfalse
+\DeclareOptionX{mouseover}{\@fancytooltips@mouseovertrue}
+
+\newif\if@fancytooltips@inactive\@fancytooltips@inactivefalse
+\DeclareOptionX{inactive}{\@fancytooltips@inactivetrue}
+
+\newif\if@fancytooltips@active\@fancytooltips@activefalse
+\DeclareOptionX{active}{\@fancytooltips@activetrue}
+
+\newif\if@fancytooltips@fg\@fancytooltips@fgfalse
+\DeclareOptionX{fg}{\@fancytooltips@fgtrue}
+
+\DeclareOptionX{filename}{\xdef\TooltipFilename{#1}}
+\DeclareOptionX{pages}{\xdef\TooltipPages{#1}}
+
+\newif\if@fancytooltips@blur\@fancytooltips@blurfalse
+\DeclareOptionX{blur}[0.4]{\@fancytooltips@blurtrue
+ \xdef\fancytooltips@transparency{#1}}
+
+\newif\if@fancytooltips@fixcolor\@fancytooltips@fixcolorfalse
+\DeclareOptionX{fixcolor}{\@fancytooltips@fixcolortrue}
+
+\newif\if@fancytooltips@preview\@fancytooltips@previewfalse
+\DeclareOptionX{preview}{\@fancytooltips@previewtrue}
+
+\newif\if@fancytooltips@previewall\@fancytooltips@previewallfalse
+\DeclareOptionX{previewall}{\@fancytooltips@previewtrue\@fancytooltips@previewalltrue}
+
+\newif\if@fancytooltips@nosoap\@fancytooltips@nosoapfalse
+\DeclareOptionX{nosoap}{\@fancytooltips@nosoaptrue}
+
+\def\@@fancytipmark{}
+\DeclareOptionX{tooltipmark}{\xdef\@@fancytipmark{#1}}
+
+\def\fancytooltipsdebugmsg{}
+\DeclareOptionX{debug}{\def \fancytooltipsdebugmsg
+{
+if (this.getField("ikona") == null)
+ {app.alert("No buttons for placing tootlips are available. Contact the author. The file may need more compilations.");}
+ else
+ {app.alert("Buttons for placing tooltips are available. Congratulations! Hope everything will work.");}
+if (this.getField("animtiph") == null)
+ {app.alert("No hidden buttons containing tooltips available. The interactive features will not work. \n\n If you created the file by dvips, run the command ImportTooltips() in the Javascript console (Ctrl+J, write the command followed by semicolon and Ctrl+Enter).");}
+ else
+ {app.alert("Hidden buttons containing tooltips are available. Congratulations! Hope everything will work.");}
+}}
+
+\ProcessOptionsX
+
+\if@fancytooltips@blur
+\ifTooltip@usepdftex\else
+\@fancytooltips@blurfalse
+\AtEndDocument{\PackageWarning{fancytooltips}
+ {Blur option is incompatible with dvips. ^^J The option blur is turned off }}
+\fi
+\fi
+
+\ifTooltip@usepdftex\else
+\@fancytooltips@fgfalse
+\fi
+
+\newdimen\buttontipwidth
+\newdimen\buttontipheight
+\newdimen\fancy@a
+\newdimen\fancy@b
+\newdimen\fancy@layerHshift\fancy@layerHshift=0pt
+\newdimen\fancy@layerVshift\fancy@layerVshift=0pt
+\newdimen\fancy@button@Vshift \fancy@button@Vshift=0pt
+\newdimen\fancy@button@Hshift \fancy@button@Hshift=0pt
+\newtoks\pos@fancy@toks
+
+\if@fancytooltips@active\@fancytooltips@inactivefalse\fi
+
+\if@fancytooltips@inactive
+\newcommand{\tooltip}{\@ifstar\tooltip@Star\tooltip@NoStar}%
+\newcommand{\tooltip@Star}[2]{#1}%
+\newcommand{\tooltip@NoStar}[2]{#1}%
+
+\newcommand{\tooltipanim}{\@ifstar\tooltipanim@Star\tooltipanim@NoStar}%
+\newcommand{\tooltipanim@Star}[3]{#1}%
+\newcommand{\tooltipanim@NoStar}[3]{#1}%
+\def\keytip#1{}%
+\def\TooltipPage#1#2{}%
+\let\TooltipExtratext\relax
+\let\TooltipRefmark\relax
+\ifx\@ocg@makeknown\undefined
+ \def\@ocg@makeknown#1#2#3{}\fi
+\def\fancy@@pushButton#1#2#3#4#5#6#7#8{}
+\def\fancy@@anim@pushButton#1#2#3#4#5#6#7#8#9{}
+
+\PackageWarning{fancytooltips}{Fancytooltips inactive}%
+\expandafter\endinput\fi
+
+% \end{macrocode}
+% Each |\ref| command has associated a number and writes new label
+% into aux file. If the target page for the ref is different from the
+% page with this |\ref| command, the corresponding tooltip is inserted.
+% \begin{macrocode}
+\newcount\fancycheckcount\fancycheckcount=0
+\def\fancy@second#1#2#3#4{#2}
+
+\def\fancypreview@refhook{%
+\global\let\oldref\ref
+\gdef\ref##1{\oldref{##1}\global\advance\fancycheckcount by 1\relax
+\edef\templabel{fancyanchorref:\the\fancycheckcount}%
+\expandafter\label\expandafter{\templabel}%
+\expandafter\ifx \csname FancyToolTip@##1\endcsname\relax \else\hbox to 0 pt{%
+% \end{macrocode}
+% Here we extract the page number for the label destination.
+% \begin{macrocode}
+ \expandafter\ifx \csname r@##1\endcsname \relax\else
+ \expandafter\let\expandafter\fancytooltip@temp@a\csname r@##1\endcsname
+ \edef\fan@tempa{\expandafter\fancy@second\fancytooltip@temp@a}%
+ \fi
+% \end{macrocode}
+% Here we extract the page number of the |\ref| command via faked label |fancyanchorref:\the\fancycheckcount|.
+% \begin{macrocode}
+ \expandafter\ifx \csname r@fancyanchorref:\the\fancycheckcount\endcsname \relax\else
+ \expandafter\let\expandafter\fan@temp@w\csname r@fancyanchorref:\the\fancycheckcount\endcsname
+ \edef\fan@temp@ww{\expandafter\fancy@second\fan@temp@w}%
+ \fi
+% \end{macrocode}
+% We print tooltip after |\ref| only if both |\label| and |\ref| commands are on different pages
+% \begin{macrocode}
+\if@fancytooltips@previewall\def\fan@tempa{not a page number}\fi
+\ifx\fan@tempa\fan@temp@ww\else\smash{%
+ \let\TooltipExtratext\relax\tooltip{\strut\TooltipRefmark}{##1}}%
+\fi
+\hss}%
+\fi}%
+% \end{macrocode}
+% We replace the cite command. We test if natbib is loaded, if not, we redefine the command from article.cls.
+% \begin{macrocode}
+\ifx\NAT@citea@mbox\undefined
+\def\@citex[##1]##2{\leavevmode
+ \let\@citea\@empty
+ \@cite{\@for\@citeb:=##2\do
+ {\@citea\def\@citea{,\penalty\@m\ }%
+ \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
+ \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
+ \@ifundefined{b@\@citeb}{\hbox{\reset@font\bfseries ?}%
+ \G@refundefinedtrue
+ \@latex@warning
+ {Citation `\@citeb' on page \thepage \space undefined}}%
+ {\ifx\csname r@fancy:cite:\@citeb\endcsname\undefined \@cite@ofmt{\csname b@\@citeb\endcsname}\else\tooltip*{\@cite@ofmt{\csname b@\@citeb\endcsname}}{fancy:cite:\@citeb}\fi
+ }}}{##1}}%
+\else
+\def\NAT@citea@mbox{%
+ \@citea\mbox{\NAT@hyper@{{\citenumfont{\NAT@num}}}}\tooltip*{}{fancy:cite:\@citeb}}
+\fi
+}
+
+\if@fancytooltips@nosoap
+ \def\TooltipRefmark{\hbox{\ }}%
+\else
+ \ifTooltip@usepdftex
+ \def\TooltipRefmark{\hbox {\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+ {fancytipmark\@@fancytipmark.pdf}}}}}%
+ \else
+ \def\TooltipRefmark{\hbox {\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+ {fancytipmark.eps}}}}}%
+ \fi%\ifTooltip@usepdftex
+\fi%\if@fancytooltips@nosoap
+
+\if@fancytooltips@preview\AtBeginDocument{\fancypreview@refhook}\fi
+
+\if@fancytooltips@createtips
+% \end{macrocode}
+% This part (three lines) is processed if the option |createtips| is
+% used. In the opposite case we process the second part, up to the end
+% of the package.
+% \begin{macrocode}
+\newwrite\tipfile
+\immediate\openout\tipfile \jobname.tips
+\def\keytip#1{\write\tipfile{\string\tooltipname{#1}{\arabic{page}}}}
+\expandafter\endinput\fi
+% \end{macrocode}
+% This part is processed if the option |createtips| is not used. We
+% define macros which put the hidden button with the name |ikona.n| in
+% the background of the page |n|, if one of the commands |\tooltip| or
+% |\tooltipanim| has been used on this page. Javascripts defined by
+% |\tooltip| and |\tooltipanim| commands then unhide this button and
+% show the corresponding picture.
+% \begin{macrocode}
+
+\ifx\TooltipFilename\undefined
+\PackageWarning{fancytooltips}{** The filename with tooltips is not given. **}
+\fi
+
+\ifTooltip@usepdftex
+\RequirePackage[pdftex]{eforms}
+\def\TooltipExtratext{\hbox{\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+ {fancytipmark\@@fancytipmark.pdf}}}}}
+\else
+\RequirePackage[dvips]{eforms}
+\def\TooltipExtratext{\hbox{\smash{\raisebox{0.4em}{\includegraphics[width=0.7em]%
+ {fancytipmark.eps}}}}}
+\fi%\ifTooltip@usepdftex
+
+\if@fancytooltips@nosoap
+ \def\TooltipExtratext{\hbox{\ }}%
+\fi%\if@fancytooltips@nosoap
+
+\if@fancytooltips@extratext\else\let\TooltipExtratext\relax\fi
+
+\AtBeginDocument{
+\global\buttontipwidth=\paperwidth
+\global\buttontipheight=\paperheight
+}
+
+\ifTooltip@usepdftex
+\def\frametip@{%
+ \pdfstartlink user{%
+ /Subtype /Widget
+ /F 6
+ /T (ikona.\thepage)
+ /FT /Btn
+ /Ff 65536
+ /H /N
+ /BS << /W 1 /S /S >>
+ /MK << /TP 1 /IF <</A[1.0 1.0]/SW /B>> >>
+ }%
+ \vbox to \buttontipheight {\vss\hbox to \buttontipwidth{\hss}}\pdfendlink}%
+\else
+% \end{macrocode}
+% For dvips users we use the macros from eqxerquiz.sty package.
+% \begin{macrocode}
+\def\everyeqIcon#1{\def\every@eqIcon{#1}}
+\def\every@eqIcon{}
+\newcommand\eqIconFTT[4][]
+{%
+ \push@@Button{#1}{#2}{#3}{#4}{}{\eq@setButtonProps\eq@Button@driver}%
+ {\eqIconDefaults\every@ButtonField\every@eqIcon}%
+}
+\def\eqIconDefaults
+{%
+ \rawPDF{}\S{}\mkIns{/TP 1 /IF<</A[1.0 1.0]/SW/B>>}\R{0}
+ \CA{}\RC{}\AC{}\BC{}\BG{}\H{B}
+ \textColor{0 g}\Ff{\FfReadOnly}
+}
+\def\frametip@{\eqIconFTT[\BC{}\BG{}\F{\FHidden}]%
+ {ikona.\thepage}{\paperwidth}{\paperheight}%
+}%
+\fi%\ifTooltip@usepdftex
+
+\def\fancytooltips@one{1}
+\if@fancytooltips@blur
+ \RequirePackage{ocg}
+ \ifx\fancytooltips@one\fancytooltips@transparency
+ \def\transparent#1{}
+ \else
+ \RequirePackage{transparent}
+ \fi
+\else
+ \ifx\@ocg@makeknown\undefined
+ \def\@ocg@makeknown#1#2#3{}\fi
+\fi
+
+\if@fancytooltips@fg
+\else
+\RequirePackage{eso-pic}
+\def\frametip{%
+ \expandafter\ifx \csname TooltipPage\thepage\endcsname\relax
+ \else
+ \setbox0=\hbox{\frametip@}%
+ \hbox{\raise \dp0 \box0}
+ \fi}%
+\AddToShipoutPicture{\hbox to 0 pt{\frametip\hss}}
+\fi
+
+\def\fancytooltips@save@position{\pdfsavepos%
+ \write\@auxout{\string\global\string \fancy@layerVshift \the\pdflastypos sp\string\relax}%
+ \write\@auxout{\string\global\string \fancy@layerHshift \the\pdflastxpos sp\string\relax}%
+ \global\let\fancytooltips@save@position\relax%
+}
+
+\def\fancy@beginshipout@hook{}
+\AtBeginShipout{%
+\TooltipPageopencloseJS
+\setbox\AtBeginShipoutBox=\hbox{%
+ \hbox to 0 pt{\TooltipHidden}\global\def\TooltipHidden{}%
+ \fancy@beginshipout@hook\if@fancytooltips@fixcolor\hbox to 0 pt{\resizebox{1pt}{!}{\TooltipExtratext}\hss}\fi
+ \hbox to 0 pt{\box\AtBeginShipoutBox\hss}%
+ \ifTooltip@usepdftex
+ \fancytooltips@save@position
+ \if@fancytooltips@blur
+ \expandafter\ifx \csname TooltipPage\thepage\endcsname\relax \else
+ \lower\fancy@layerVshift\hbox to 0 pt{\kern-\fancy@layerHshift\relax
+ \begin{ocg}{fancyOCG\thepage}{fancyOCG\thepage}{0}%
+ \expandafter\transparent\expandafter{\fancytooltips@transparency}%
+ \color{black}%
+ \vbox to 0 pt{\vss\hbox{\vrule width \paperwidth height \paperheight}}%
+ \end{ocg}\hss}%
+ \fi
+ \fi%\if@fancytooltips@blur
+ \if@fancytooltips@fg
+ \expandafter\ifx \csname TooltipPage\thepage\endcsname\relax
+ \else
+ \lower\fancy@layerVshift\vbox to 0 pt{\vss\hbox to 0 pt{\kern-\fancy@layerHshift\relax\hbox{\frametip@}\hss}}%
+ \fi%\ifx
+ \lower\fancy@layerVshift\vbox to 0 pt{\vss\hbox to 0 pt{\kern-\fancy@layerHshift\relax\hbox to 0 pt{\the\pos@fancy@toks\hss}\hss}}%
+ \fi%\if@fancytooltips@fg
+ \fi%\ifTooltip@usepdftex
+ \kern\hsize}%
+}%
+
+% \end{macrocode}
+% In the macros |\tooltip| and |\tooltipanim| we print the text into
+% box with zero dimensions and then we build a button which covers
+% this text and has an associated JavaScript action. The important
+% part is the |\PushButton| macro. You can adjust these macros or
+% write similar macros which do what you need.
+% \begin{macrocode}
+\definecolor{tooltipcolor}{rgb}{0,0,1}
+
+\newcount\tooltip@count
+\newtoks\tooltip@toks
+\newtoks\tooltip@pagetoks
+\tooltip@pagetoks={\thepage}
+\def\tooltippage{}
+
+\def\TooltipPage#1#2{%
+\expandafter\gdef\csname TooltipPage#2\endcsname{#2}%
+\expandafter\gdef\csname Tooltipcount2page#1\endcsname{#2}%
+}
+% \end{macrocode}
+% We use the hack for Adobe Acrobat suggested by DPS and Jorg at
+% http://www.acrotex.net/forum/showthread.php?tid=78.
+% \begin{macrocode}
+
+\def\fancy@JS#1{\JS{var DirtyBeforeTooltip=this.dirty; #1
+ this.dirty=DirtyBeforeTooltip;}}
+
+\newcommand{\tooltip}{\@ifstar
+ \tooltip@Star%
+ \tooltip@NoStar%
+}
+
+\newcommand{\tooltip@Star}[2]{{\color{tooltipcolor}#1}%
+ {\let\SaveTooltipExtratext\TooltipExtratext
+ \let\TooltipExtratext\relax
+ \hbox to 0 pt{\tooltip@NoStar{\SaveTooltipExtratext
+ \vrule height 10pt depth 0 pt width 0 pt}{#2}\hss}}}
+
+\newcommand{\tooltip@NoStar}[2]{%
+ \global\advance\tooltip@count by 1%
+ \edef\act{\write\@auxout{\noexpand\string\noexpand\TooltipPage{\the\tooltip@count}{\the\tooltip@pagetoks}}}\act
+ \expandafter\ifx\csname Tooltipcount2page\the\tooltip@count \endcsname\relax
+ \global\edef\tooltippage{}
+ \else
+ \global\edef\tooltippage{\csname Tooltipcount2page\the\tooltip@count \endcsname}%
+ \fi
+ \checkTipNumber{#2}\edef\TipNumber{\FindTipNumber{#2}}%
+ \leavevmode
+ \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\copy0\fancy@a=\dp0\advance\fancy@a by \ht0\relax\hbox to 0 pt{\smash{\TooltipExtratext}\hss}\fancy@pushButton{\TipNumber}{\tooltippage}{TooltipField}{\wd0}{\fancy@a}{\dp0}}
+
+\def\fancy@tooltip@options#1#2{\BC{}\BG{}
+ \S{}\AA{\AAMouseExit{\fancy@JS{CloseTooltips();}}%
+ \if@fancytooltips@mouseover
+ \AAMouseEnter{\fancy@JS{this.getField("ikona."+(#2)).hidden=false;
+ try {app.clearInterval(animace);}catch (e) {}
+ \if@fancytooltips@movetips nastav(#1,#2);\fi
+ \if@fancytooltips@blur
+ try{
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ if(fancytooltipsOCGs[i].name == "fancyOCG"+(#2))
+ fancytooltipsOCGs[i].state = true;
+ else
+ fancytooltipsOCGs[i].state = false;
+ }} catch (e) {};
+ \fi
+ zobraz(#1,#2);
+ }}
+ \fi}
+ \A{\fancy@JS{this.getField("ikona."+(#2)).hidden=false;
+ try {app.clearInterval(animace);}catch (e) {}
+ \if@fancytooltips@movetips nastav(#1,#2);\fi
+ \if@fancytooltips@blur
+ try {
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ if(fancytooltipsOCGs[i].name == "fancyOCG"+(#2))
+ fancytooltipsOCGs[i].state = true;
+ else
+ fancytooltipsOCGs[i].state = false;
+ }} catch (e) {};
+ \fi
+ zobraz(#1,#2);
+ }}}
+
+\newtoks\@fxtoks\@fxtoks={\the\pdflastxpos}
+\newtoks\@fytoks\@fytoks={\the\pdflastypos}
+
+\def\fancy@pushButton#1#2#3#4#5#6{%
+ \lower #6\hbox to 0 pt{\hss\expandafter\pushButton\expandafter[\fancy@tooltip@options{#1}{#2}]{#3}{#4}{#5}}}
+\def\fancy@@pushButton#1#2#3#4#5#6#7#8{}
+
+\ifTooltip@usepdftex
+\if@fancytooltips@fg
+\def\fancy@pushButton#1#2#3#4#5#6{\pdfsavepos%
+ \edef\act{\write\@auxout{\string\fancy@@pushButton{#1}{#2}{#3}{\the#4}{\the#5}{\the\@fxtoks}{\the\@fytoks}{\the#6}}}\act%
+}
+\def\fancy@@pushButton#1#2#3#4#5#6#7#8{%
+ \expandafter\global\expandafter\pos@fancy@toks\expandafter{\the\pos@fancy@toks\fancy@onlypage{#2}{\vbox to 0 pt{\vss\hbox to 0 pt{\kern #6 sp\hbox to 0 pt{\hss\expandafter\pushButton\expandafter[\fancy@tooltip@options{#1}{#2}]{#3}{#4}{#5}}\hss}\kern #7sp\kern-#8}}}}
+\fi
+\fi
+
+
+\def\fancy@onlypage#1#2{\def\ft@a{#1}\edef\ft@b{\thepage}%
+\ifx\ft@a\ft@b#2\fi}
+
+
+\def\delayinterval{200}
+
+\newcommand{\tooltipanim}{\@ifstar
+ \tooltipanim@Star%
+ \tooltipanim@NoStar%
+}
+
+\newcommand{\tooltipanim@Star}[3]{{\color{tooltipcolor}#1}%
+ {\let\SaveTooltipExtratext\TooltipExtratext
+ \let\TooltipExtratext\relax
+ \hbox to 0 pt{\tooltipanim@NoStar{\SaveTooltipExtratext
+ \vrule height 10pt depth 0 pt width 0 pt}{#2}{#3}\hss}}}
+
+\newcommand{\tooltipanim@NoStar}[3]{%
+ \global\advance\tooltip@count by 1%
+ \edef\act{\write\@auxout{\noexpand\string\noexpand\TooltipPage{\the\tooltip@count}{\the\tooltip@pagetoks}}}\act
+ \expandafter\ifx\csname Tooltipcount2page\the\tooltip@count \endcsname\relax
+ \global\edef\tooltippage{}
+ \else
+ \global\edef\tooltippage{\csname Tooltipcount2page\the\tooltip@count \endcsname}%
+ \fi
+ \checkTipNumber{#2}\edef\TipNumberA{\FindTipNumber{#2}}%
+ \checkTipNumber{#3}\edef\TipNumberB{\FindTipNumber{#3}}%
+ \leavevmode
+ \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\copy0\fancy@a=\dp0\advance\fancy@a by \ht0\relax\hbox to 0 pt{\smash{\TooltipExtratext}\hss}\fancy@anim@pushButton{\TipNumberA}{\tooltippage}{TooltipField}{\wd0}{\fancy@a}{\dp0}{\TipNumberB}}
+
+
+\def\fancy@tooltipanim@options#1#2#3{
+\BC{}\BG{}\S{}\AA{\AAMouseExit{\fancy@JS{CloseTooltips();}}
+ \if@fancytooltips@mouseover
+ \AAMouseEnter{\fancy@JS{
+ try {app.clearInterval(animace);}catch (e) {}
+ var cislo=#1;
+ \if@fancytooltips@movetips nastav(#1,#2);\fi
+ \if@fancytooltips@blur
+ try{
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ if(fancytooltipsOCGs[i].name == "fancyOCG"+(#2))
+ fancytooltipsOCGs[i].state = true;
+ else
+ fancytooltipsOCGs[i].state = false;
+ }} catch (e) {};
+ \fi
+ function animuj()
+ {
+ var DirtyBeforeTooltipanim=this.dirty;
+ if (cislo<#3) cislo=cislo+1;
+ this.getField('ikona.'+(#2)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon());
+ this.dirty=DirtyBeforeTooltipanim;
+ };
+ this.getField('ikona.'+(#2)).buttonSetIcon(this.getField("animtiph."+#1).buttonGetIcon());
+ this.getField("ikona."+(#2)).hidden=false;
+ animace=app.setInterval('animuj();', \delayinterval);
+ }}
+ \fi}
+ \A{\fancy@JS{
+ try {app.clearInterval(animace);}catch (e) {}
+ var cislo=#1;
+ \if@fancytooltips@movetips nastav(#1,#2);\fi
+ \if@fancytooltips@blur
+ try{
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ if(fancytooltipsOCGs[i].name == "fancyOCG"+(#3))
+ fancytooltipsOCGs[i].state = true;
+ else
+ fancytooltipsOCGs[i].state = false;
+ }} catch (e) {};
+ \fi
+ function animuj()
+ {
+ var DirtyBeforeTooltipanim=this.dirty;
+ if (cislo<#3) cislo=cislo+1;
+ this.getField('ikona.'+(#2)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon());
+ this.dirty=DirtyBeforeTooltipanim;
+ };
+ this.getField('ikona.'+(#2)).buttonSetIcon(this.getField("animtiph."+#1).buttonGetIcon());
+ this.getField("ikona."+(#2)).hidden=false;
+ animace=app.setInterval('animuj();', \delayinterval);
+ }}
+}
+
+
+\def\fancy@anim@pushButton#1#2#3#4#5#6#7{%
+ \lower #6 \hbox to 0 pt{\hss\expandafter\pushButton\expandafter[\fancy@tooltipanim@options{#1}{#2}{#7}]{#3}{#4}{#5}}}
+\def\fancy@@anim@pushButton#1#2#3#4#5#6#7#8#9{}
+
+\ifTooltip@usepdftex
+\if@fancytooltips@fg
+\def\fancy@anim@pushButton#1#2#3#4#5#6#7{\pdfsavepos%
+ \edef\act{\write\@auxout{\string\fancy@@anim@pushButton{#1}{#2}{#3}{\the#4}{\the#5}{\the\@fxtoks}{\the\@fytoks}{\the#6}{#7}}}\act%
+}
+\def\fancy@@anim@pushButton#1#2#3#4#5#6#7#8#9{%
+ \expandafter\global\expandafter\pos@fancy@toks\expandafter{\the\pos@fancy@toks\fancy@onlypage{#2}{\vbox to 0 pt{\vss\hbox to 0 pt{\kern #6 sp\hbox to 0 pt{\hss\expandafter\pushButton\expandafter[\fancy@tooltipanim@options{#1}{#2}{#9}]{#3}{#4}{#5}}\hss}\kern #7sp\kern-#8}}}}
+\fi
+\fi
+
+
+% \end{macrocode}
+% This code closes tooltip if the page is closed.
+% \begin{macrocode}
+\edef\fancytooltips@pdfpageattrJS{%
+ var DirtyBeforeCloseTooltip=this.dirty;
+ \if@fancytooltips@blur
+ try{
+ var temp = fancytooltipsOCGs.length;
+ for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {
+ fancytooltipsOCGs[i].state = false;
+ }
+ }
+ catch (e){}
+ \fi
+ CloseTooltips();
+ this.dirty=DirtyBeforeCloseTooltip;
+}
+\ifTooltip@usepdftex
+\edef\fancy@temp{/AA << /O << /S /JavaScript /JS (
+ \fancytooltips@pdfpageattrJS) >> >>}
+\expandafter\def\expandafter\TooltipPageopencloseJS\expandafter{
+\expandafter\global\expandafter\pdfpageattr\expandafter{\fancy@temp}%
+}
+\pdfximage{\TooltipFilename.pdf}%
+\edef\TooltipPages{\the\pdflastximagepages}%
+\else
+\edef\fancy@temp{ [ {ThisPage} << /AA <<
+ /O << /S /JavaScript /JS (var DirtyBeforeCloseTooltip=this.dirty; CloseTooltips(); this.dirty=DirtyBeforeCloseTooltip;) >>
+ >> >> /PUT pdfmark}
+\expandafter\def\expandafter\TooltipPageopencloseJS\expandafter{
+\expandafter\literalps@out\expandafter{\fancy@temp}}
+\edef\fancy@@temp{/S /JavaScript /JS ( \fancytooltips@pdfpageattrJS)}
+\expandafter\OpenAction\expandafter{\fancy@@temp}
+\fi%\ifTooltip@usepdftex
+
+\ifTooltip@usepdftex
+\def\fancytempA{}
+\ifx\FancytooltipsAfterClose\undefined\else\edef\fancytempA{\FancytooltipsAfterClose}\fi
+\def\fancytempAA{}
+\ifx\FancytooltipsAfterShow\undefined\else\edef\fancytempAA{\FancytooltipsAfterShow}\fi
+
+\if@fancytooltips@blur
+\def\fancytempAAA{
+% \end{macrocode}
+% OCG's have not been initialized yet, do it now.
+% \begin{macrocode}
+ var inifancytooltipsOCGs = this.getOCGs();
+ var fancytooltipsOCGs = [];
+ for(var i=0; inifancytooltipsOCGs && i<inifancytooltipsOCGs.length;i++)
+ {
+ if(inifancytooltipsOCGs[i].name.substr(0,5) == "fancy")
+ {
+ fancytooltipsOCGs.push(inifancytooltipsOCGs[i]);
+ inifancytooltipsOCGs[i].state=false;
+ }
+ }
+ inifancytooltipsOCGs[0].state=true;
+ inifancytooltipsOCGs[0].state=false;
+}
+\else
+\def\fancytempAAA{}
+\fi
+
+\if@fancytooltips@blur
+\def\fancytempB{
+ try {for(var i=0; fancytooltipsOCGs && i<fancytooltipsOCGs.length;i++)
+ {fancytooltipsOCGs[i].state = false;} } catch (e) {}}
+\else
+\def\fancytempB{}
+\fi
+
+
+\begin{insDLJS}[fancyTooltipsLoaded]{Tooltipsdljs}{DLJS for Tooltips}
+ \fancytooltipsdebugmsg
+
+ var animace;
+ var fancyTooltipsLoaded = true;
+
+ \fancytempAAA
+
+ function CloseTooltips()
+ {
+ try {this.getField("ikona").hidden=true;}catch (e) {}
+ try {app.clearInterval(animace);}catch (e) {}
+ \fancytempB
+ \fancytempA
+ }
+
+ function nastav(cislo,strana)
+ {
+ var f=this.getField("ikona."+(strana));
+ var g=this.getField("animtiph."+cislo);
+ var sourf=f.rect;
+ var sourg=g.rect;
+ if ((mouseX+sourg[2]-sourg[0])<sourf[2])
+ var percX=100*(mouseX-sourf[0])/((sourf[2]-sourf[0])-(sourg[2]-sourg[0]));
+ else
+ var percX=100*(mouseX-sourf[0]-(sourg[2]-sourg[0]))/((sourf[2]-sourf[0])-(sourg[2]-sourg[0]));
+ var percY=100*(mouseY-sourf[3])/((sourf[1]-sourf[3])-(sourg[1]-sourg[3]));
+ if (percX>100) percX=100;
+ if (percY>100) percY=100;
+ if (percX<0) percX=0;
+ if (percY<0) percY=0;
+ f.buttonAlignX=percX;
+ f.buttonAlignY=percY;
+ }
+
+ function zobraz(cislo,strana)
+ {
+ var f=this.getField("ikona."+(strana));
+ var g=this.getField("animtiph."+cislo);
+ f.hidden=false;
+ f.buttonSetIcon(g.buttonGetIcon());
+ \fancytempAA
+ }
+
+ this.dirty=false;
+ app.focusRect = false;
+\end{insDLJS}
+\else
+\begin{insDLJS}[fancyTooltipsLoaded]{Tooltipsdljs}{DLJS for Tooltips}
+ var animace;
+ var fancyTooltipsLoaded = true;
+
+ \fancytooltipsdebugmsg
+
+ function CloseTooltips()
+ {
+ try {this.getField("ikona").hidden=true;}catch (e) {}
+ try {app.clearInterval(animace);}catch (e) {}
+ }
+
+ function ImportTooltips()
+ {
+ console.println("importing pictures");
+ for (var i=1;i<=\TooltipPages;i++)
+ {
+ this.insertPages(this.numPages-1,"\TooltipFilename.pdf",(i-1),(i-1));
+ var rozm=this.getPageBox("Crop",this.numPages-1);
+ this.deletePages(this.numPages-1);
+ var p=this.addField("animtiph."+i,"button",0,rozm);
+ p.buttonPosition=position.iconOnly;
+ p.hidden=true;
+ this.getField("animtiph."+i).buttonImportIcon("\TooltipFilename.pdf",(i-1));
+ }
+ console.println("Imported \TooltipPages pictures, save the PDF file.");
+ return(1);
+ }
+
+ function nastav(cislo,strana)
+ {
+ var f=this.getField("ikona."+(strana));
+ var g=this.getField("animtiph."+cislo);
+ var sourf=f.rect;
+ var sourg=g.rect;
+ if ((mouseX+sourg[2]-sourg[0])<sourf[2])
+ var percX=100*(mouseX-sourf[0])/((sourf[2]-sourf[0])-(sourg[2]-sourg[0]));
+ else
+ var percX=100*(mouseX-sourf[0]-(sourg[2]-sourg[0]))/((sourf[2]-sourf[0])-(sourg[2]-sourg[0]));
+ var percY=100*(mouseY-sourf[3])/((sourf[1]-sourf[3])-(sourg[1]-sourg[3]));
+ if (percX>100) percX=100;
+ if (percY>100) percY=100;
+ if (percX<0) percX=0;
+ if (percY<0) percY=0;
+ f.buttonAlignX=percX;
+ f.buttonAlignY=percY;
+ }
+
+ function zobraz(cislo,strana)
+ {
+ var f=this.getField("ikona."+(strana));
+ var g=this.getField("animtiph."+cislo);
+ f.hidden=false;
+ f.buttonSetIcon(g.buttonGetIcon());
+ }
+
+ this.dirty=false;
+ app.focusRect = false;
+\end{insDLJS}
+\fi
+% \end{macrocode}
+% A cycle is used to create hidden buttons. Each button has associated a page
+% from the file with tooltips as icon. These icons are invoked by JavaScripts
+% defined in |\tooltip| and |\tooltipanim| macros.
+% \begin{macrocode}
+\newcount\tooltip@count
+\ifTooltip@usepdftex
+\newcommand*{\TooltipHidden}{%
+ \count@=0
+ \@whilenum\count@<\TooltipPages \do{%
+ \tooltip@count=\count@
+ \advance \tooltip@count by 1%
+ \bgroup
+ \immediate\pdfximage
+ page \the\tooltip@count{\TooltipFilename.pdf}%
+ \mbox{\leavevmode
+ \vbox to 0 pt{\vss\hbox to 0 pt{\pdfstartlink user{%
+ /Subtype /Widget
+ /F 6
+ /T (animtiph.\the\tooltip@count)
+ /FT /Btn
+ /Ff 65536
+ /H /N
+ /BS << /W 1 /S /S >>
+ /MK <<
+ /TP 1
+ /I \the\pdflastximage\space 0 R
+ /IF << /SW /A >>
+ >>
+ }%
+ \phantom{\pdfrefximage \pdflastximage}%
+ \pdfendlink\hss}}}%
+ \egroup
+ \advance\count@\@ne}%
+}
+\else
+\let\TooltipHidden\relax
+\fi
+% \end{macrocode}
+% The keywords for the tooltips can be stored in the file
+% |\TooltipFilename.tips|. The topics in this file are created by
+% |\keytip| macro (see the first part of the code).
+% \begin{macrocode}
+\AtBeginDocument{\IfFileExists{\TooltipFilename.tips}%
+ {\input{\TooltipFilename.tips}
+ \PackageInfo{fancytooltips}{Inputting \TooltipFilename.tips.}}%
+ {\PackageWarning{fancytooltips}{No file \TooltipFilename.tips!
+ Your keywords for tooltips will not work!}}}
+
+\def\tooltipname#1#2{\expandafter\xdef\csname FancyToolTip@#1\endcsname{#2}}
+
+\def\FindTipNumber#1{\expandafter\ifx \csname FancyToolTip@#1\endcsname\relax
+ #1\else\csname FancyToolTip@#1\endcsname\fi}
+
+\def\checkTipNumber#1{\expandafter\ifx
+ \csname FancyToolTip@#1\endcsname\relax \PackageInfo{fancytooltips}{No
+ framenumber is assigned to keyword #1. I assume that #1 is the
+ number of the frame.}%
+ \fi}
+
+%</package>
+% \end{macrocode}
+%
+% \Finale
+\endinput
+
+
+
diff --git a/macros/latex/contrib/fancytooltips/fancytooltips.ins b/macros/latex/contrib/fancytooltips/fancytooltips.ins
new file mode 100644
index 0000000000..03c6ac387e
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytooltips.ins
@@ -0,0 +1,58 @@
+%%
+%% Copyright (C) 2007 by Robert Marik <marik@mendelu.cz>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.2 of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.2 or later is part of all distributions of LaTeX version
+%% 1999/12/01 or later.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/fancytooltips}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2007 by Robert Marik <marik@mendelu.cz>
+
+This file may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.2 of this license
+or (at your option) any later version. The latest version of this
+license is in:
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.2 or later is part of all distributions of LaTeX version
+1999/12/01 or later.
+
+\endpreamble
+
+\generate{\file{fancytooltips.sty}{\from{fancytooltips.dtx}{package}}
+}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* files into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* fancytooltips.sty *}
+\Msg{* fancytipmark.pdf *}
+\Msg{* fancytipmark.eps *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* fancytooltips.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
diff --git a/macros/latex/contrib/fancytooltips/fancytooltips.pdf b/macros/latex/contrib/fancytooltips/fancytooltips.pdf
new file mode 100644
index 0000000000..31b4cf547e
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/fancytooltips.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/readme b/macros/latex/contrib/fancytooltips/readme
new file mode 100644
index 0000000000..b89444c5ab
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/readme
@@ -0,0 +1,17 @@
+The fancytooltips package:
+--------------------------
+
+The package was inspired by the cooltooltips package. In contrast to
+cooltooltips, fancytooltips allows inclusion of tooltips which contain
+arbitrary TeX material or a series of TeX materials (aminated graphics) from
+an external PDF file. The links and JavaScripts are inserted using eforms
+package from the AcroTeX bundle. Similar packages are cooltooltips,
+pdfcomment, ocgtools and AcroTeX. The PDF file must be opened in (free)
+Adobe Reader.
+
+Possible applications include automatical extraction of equations,
+definitions, theorems and other stuff from the document and inserting
+previews to \ref, \cite and \eqref commands.
+
+Supported by grants 18/2006, 99/2008 and 131/2010 of Higher Education
+Development Fund (FRVS).
diff --git a/macros/latex/contrib/fancytooltips/tip.pdf b/macros/latex/contrib/fancytooltips/tip.pdf
new file mode 100644
index 0000000000..e45dec7da5
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/tip.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancytooltips/tip.tex b/macros/latex/contrib/fancytooltips/tip.tex
new file mode 100644
index 0000000000..e34f9584c9
--- /dev/null
+++ b/macros/latex/contrib/fancytooltips/tip.tex
@@ -0,0 +1,30 @@
+\documentclass{article}
+\usepackage[papersize={2cm,2cm},margin=1pt]{geometry}
+\usepackage{color}
+
+\long\def\strankaB#1{
+\setbox0=\hbox{\fboxsep 0 pt
+\color{red}
+\shadowbox{{\fboxsep 4pt\colorbox{yellow}
+ {\color{black}#1
+ }}}}
+\pdfpagewidth=\wd0
+\pdfpageheight=\ht0
+\advance \pdfpageheight by \dp0
+\copy0
+\newpage
+}
+
+\usepackage{fancybox}
+\begin{document}
+
+
+\strankaB{\Huge $E=mc^2$}
+
+\strankaB{\LARGE number $ 1$}
+\strankaB{\LARGE number $ 2$}
+\strankaB{\LARGE number $ 3$}
+\strankaB{\LARGE number $ 4$}
+\strankaB{\LARGE number $ 5$}
+\strankaB{\LARGE number $ 6$}
+\end{document}