blob: cab102fce2fb6fba21b77e08bc4ca86e969558a7 (
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
|
\documentclass[a4paper]{ltxdoc}
\usepackage{ocg-p}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\newcommand*{\pkg}[1]{\textsf{#1}}
\title{\pkg{OCG-P} package, example 3}
\begin{document}
\maketitle
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.
\end{document}
|