summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ocg-p/examples/ocg-p_example_3.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/ocg-p/examples/ocg-p_example_3.tex')
-rw-r--r--macros/latex/contrib/ocg-p/examples/ocg-p_example_3.tex57
1 files changed, 57 insertions, 0 deletions
diff --git a/macros/latex/contrib/ocg-p/examples/ocg-p_example_3.tex b/macros/latex/contrib/ocg-p/examples/ocg-p_example_3.tex
new file mode 100644
index 0000000000..fdc8c8c7e2
--- /dev/null
+++ b/macros/latex/contrib/ocg-p/examples/ocg-p_example_3.tex
@@ -0,0 +1,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} \ No newline at end of file