I'm playing around with the new ocgx package. It uses TikZ nodes to place text. Unfortunately, parindent does not work in the nodes. Is there a way to make it work?
Edit (source code)
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{amsmath}
\usetikzlibrary{calc,shadows,ocgx}
\AtBeginDocument{\edef\normalparindent{\the\parindent}}
\begin{document}
\tikzset{
checkbox/.style={
draw,circle,line width=.5pt,%
minimum size=.7em,top color=white,bottom color=cyan,
fill opacity=1,
inner sep=0,
drop shadow={fill=black,shadow xshift=.5mm,shadow yshift=-.5mm},
},
mytext/.style={
text width=\textwidth,align=justify,
every node={\setlength\parindent{\normalparindent}},
inner xsep=0pt,
},
mycomment/.style={
text width=\textwidth-2cm,align=justify,
fill=yellow!20,
inner xsep=.5cm,
inner ysep=.5cm,
outer xsep=.5cm,
draw=gray,
}
}
\lipsum[1]
\bigskip
\noindent%
\begin{tikzpicture}
\begin{scope}[ocg={name=mytext,ref=mytext}]
\node[mytext]{\setlength\parindent{\normalparindent}%
In elementary algebra, the \textbf{binomial theorem} describes the algebraic expansion of powers of a binomial. According to the theorem, it is possible to expand the power $(x + y)^n$ into a sum involving terms of the form $ax^{b}y^{c}$, where the exponents $b$ and $c$ are nonnegative integers with $b + c = n$, and the coefficient $a$ of each term is a specific positive integer depending on $n$ and $b$. When an exponent is zero, the corresponding power is usually omitted from the term.
This formula and the triangular arrangement of the binomial coefficients are often attributed to Blaise Pascal, who described them in the 17th century, but they were known to many mathematicians who preceded him. The 4th century B.C. Greek mathematician Euclid mentioned the special case of the binomial theorem for exponent 2 as did the 3rd century B.C. Indian mathematician Pingala to higher orders. A more general binomial theorem and the so-called "Pascal's triangle" were known in the 10th-century A.D. to Indian mathematician Halayudha and Persian mathematician Al-Karaji, in the 11th century to Persian poet and mathematician Omar Khayyam, and in the 13th century to Chinese mathematician Yang Hui, who all derived similar results. Al-Karaji also provided a mathematical proof of both the binomial theorem and Pascal's triangle, using mathematical induction.\par
};%
\end{scope}
\begin{scope}[ocg={name=mycomment,status=invisible,ref=mycomment}]
\node[mycomment]{binomial theorem:
\begin{align}
(a+b)^{2} & = a^{2}+2ab+b^{2}\\
(a-b)^{2} & = a^{2}-2ab+b^{2}\\
(a+b)(a-b) & = a^{2}-b^{2}
\end{align}
};%
\end{scope}
\end{tikzpicture}
\par
\begin{center}
\begin{tikzpicture}
\node[checkbox,switch ocg with mark on={mycomment}{mytext,mycomment}]{};
\end{tikzpicture} show formulas
\end{center}
\bigskip
\lipsum[2]
\end{document}
- Layer 1

- Layer 2

- Layer 2 (new after Edit)




ocgxpackage is not related to this issue. (pgfmanual) Thetext widthoption will put the text of a node in a box of the given width (something akin to a {minipage}...) – Paul Gaborit Oct 01 '12 at 22:02