summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ocg-p/examples/ocg-p_example_3.tex
blob: fdc8c8c7e21ca55c1647a6a40d85c7426138a444 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
\documentclass[a4paper]{ltxdoc}

\usepackage{ocg-p}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage{color}

\newcommand*{\pkg}[1]{\textsf{#1}}

\title{\pkg{OCG-P} package, example 3}

\begin{document}

\maketitle

\section{Text layers changed by clicking on a link element}
The following text can be toggled: 
\begin{tikzpicture}[baseline=0]
\tikzstyle{nome}=[anchor=base,outer sep=0,inner sep=0,minimum height=.45cm,minimum width=4.4cm]
\begin{ocg}{blue text}{ocblueid}{1}
  \node[nome,blue]        (p1)  {\parbox[b][][t]{4.4cm}{This text is written in blue.}};
\end{ocg}
\begin{ocg}{red text}{ocredid}{0}
  \node[overlay,nome,red] (p2)  {\parbox[b][][t]{4.4cm}{This text is written in red.}};
\end{ocg}
\end{tikzpicture}
And now the text is black again.\\

\toggleocgs{ocblueid ocredid}{Click here to toggle the text!}



\section{Mouseover example}

Make the text visible by moving the mouse in the box around.

\fbox{
\begin{ocg}{This}{octhis}{0}
 \toggleocgs[triggerocg=allactions]{octhis, octhis}{This}
\end{ocg}
\begin{ocg}{text}{octext}{0}
 \toggleocgs[triggerocg=allactions]{octext, octext}{text}
\end{ocg}
\begin{ocg}{is}{ocis}{0}
 \toggleocgs[triggerocg=allactions]{ocis,ocis}{is}
\end{ocg}
\begin{ocg}{not}{ocnot}{0}
 \toggleocgs[triggerocg=allactions]{ocnot, ocnot}{not}
\end{ocg}
\begin{ocg}{visible}{ocvisible}{0}
 \toggleocgs[triggerocg=allactions]{ocvisible, ocvisible}{visible.}
\end{ocg}
}



\end{document}