diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.tex | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.tex b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.tex new file mode 100644 index 00000000000..a80693b3d73 --- /dev/null +++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.tex @@ -0,0 +1,65 @@ +\documentclass{article} +\usepackage[%latextoc, +noxcolor, +usetemplates,pdftex]{web} +%\usepackage{times} +\screensize{4.875in}{6.5in} +\margins{12pt}{24pt}{24pt}{24pt} + +\definecolor{pozadi}{rgb}{1,1,0.9} +\pagecolor{pozadi} + +%\scrollmode + +\title{OCGtools and preview} + +\optionalPageMatter{ + \begin{center} + \colorbox{yellow}{\begin{minipage}{0.5\linewidth} This is a demo + file to test cooperation between ocgtools and preview + packages. Go to the Section \ref{page} on page \pageref{page} + and put you mouse to the question marks following referrences + to figure and equation. The figure and equation should appear + in minilayer at the same page. + + The concept is DoItYourself, see the source + \texttt{.tex} file and script \texttt{ocgtools-preview.sh}. + \end{minipage}} + \end{center} +} + +\def\title#1{} +\usepackage[minimouseover]{ocgtools} + + +\ifx\ocgpreview\undefined\def\ocgpreview#1#2{#1}\fi + + \ocgpreview{\AtBeginDocument{ + \gdef\maplabeltopage#1#2{\expandafter\xdef\csname ocgtools@page@#1\endcsname{#2} +\message{^^J OCG: page #2}} + \gdef\savemaplabels#1#2#3#4{\xdef\ocgtoolstemp{#2}} + \gdef\maplabelstoall#1#2{\savemaplabels#2 \maplabeltopage{#1}{\ocgtoolstemp}} + \input preview.labels + \let\orieqref\eqref + \let\oriref\ref + \def\eqref#1{(\oriref{#1})% + \expandafter\ifx\csname ocgtools@page@#1\endcsname\relax\else + \,{\ocgminitext{$^{\text{?}}$}% + {\includegraphics[page=\csname ocgtools@page@#1\endcsname]{preview-temp}}}% + \fi}% + \def\ref#1{\oriref{#1}% + \expandafter\ifx\csname ocgtools@page@#1\endcsname\relax\else + \,{\ocgminitext{$^{\text{?}}$}% + {\includegraphics[page=\csname ocgtools@page@#1\endcsname]{preview-temp}}}% + \fi}% + }}{\AtBeginDocument{ + \newwrite\refsfile + \pagecolor{lightblue} + \immediate\openout\refsfile=preview.labels + \let\orilabel\label + \def\label#1{\orilabel{#1}\write\refsfile{\string\maplabeltopage{#1}{\thepage}}} + }} + +\input ocgtools-test.tex + +\end{document} |