diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty index 4ba86c3b76b..8722c180ffd 100644 --- a/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty +++ b/Master/texmf-dist/tex/latex/ocgx2/ocgx2.sty @@ -35,8 +35,8 @@ \RequirePackage{xparse} \RequirePackage{l3keys2e} -\def\g@ocgxii@date@tl{2018/06/07} -\def\g@ocgxii@version@tl{0.34} +\def\g@ocgxii@date@tl{2018/06/26} +\def\g@ocgxii@version@tl{0.35} \ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl} {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} @@ -899,7 +899,12 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright notice: The code that follows until the end of the file was -% taken from Paul Gaborit's `tikzlibraryocgx.code.tex' with minor additions. +% taken from Paul Gaborit's `tikzlibraryocgx.code.tex' with a minor +% addition: +% +% opts={...} allows ocg-environment options to be passed to a TikZ scope +% +% Also, it was fixed to work correctly in scaled tikzpictures. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \tikzset{ ocg/.style={ocg/.cd,#1,/tikz/.cd}, @@ -919,7 +924,7 @@ status/0/.style={visibility=0}, % default values name=, - opts=, + opts=, % NEW status=on, % ref ref/.style={ @@ -928,21 +933,20 @@ \ifx\empty\ocgxii@name\empty#1\else\ocgxii@name\fi% }{#1}{\ocgxii@visibility}}, /tikz/execute at end scope={\end{ocg}}, - }, + } }, switch ocg/.style={ postaction={ path picture={ \path let \p1 = (path picture bounding box.south west), - \p2 = (path picture bounding box.north east), - \p3 = (\x2-\x1,\y2-\y1) + \p2 = (path picture bounding box.north east) in - (path picture bounding box.center) - node[inner sep=0pt,anchor=center,outer sep=0pt] - {\switchocg*{#1}{\phantom{\rule{\x3}{\y3}}}}; + coordinate (p1) at (\p1) coordinate (p2) at (\p2) + node[inner sep=0pt,anchor=south west,outer sep=0pt] at (p1) + {\switchocg*{#1}{\tikz \useasboundingbox (p1) rectangle (p2);}}; } - }, + } }, switch ocg with mark on/.style 2 args={ postaction={ @@ -958,7 +962,7 @@ ; \end{ocg} }, - switch ocg={#1 #2}, + switch ocg={#1 #2} } }, switch ocg with mark off/.style 2 args={ @@ -975,7 +979,7 @@ ; \end{ocg} }, - switch ocg={#1 #2}, + switch ocg={#1 #2} } }, show ocg/.style={ @@ -983,41 +987,38 @@ path picture={ \path let \p1 = (path picture bounding box.south west), - \p2 = (path picture bounding box.north east), - \p3 = (\x2-\x1,\y2-\y1) + \p2 = (path picture bounding box.north east) in - (path picture bounding box.center) - node[inner sep=0pt,anchor=center] - {\showocg*{#1}{\phantom{\rule{\x3}{\y3}}}}; - }, - }, + coordinate (p1) at (\p1) coordinate (p2) at (\p2) + node[inner sep=0pt,anchor=south west,outer sep=0pt] at (p1) + {\showocg*{#1}{\tikz \useasboundingbox (p1) rectangle (p2);}}; + } + } }, hide ocg/.style={ postaction={ path picture={ \path let \p1 = (path picture bounding box.south west), - \p2 = (path picture bounding box.north east), - \p3 = (\x2-\x1,\y2-\y1) + \p2 = (path picture bounding box.north east) in - (path picture bounding box.center) - node[inner sep=0pt,anchor=center] - {\hideocg*{#1}{\phantom{\rule{\x3}{\y3}}}}; - }, - }, + coordinate (p1) at (\p1) coordinate (p2) at (\p2) + node[inner sep=0pt,anchor=south west,outer sep=0pt] at (p1) + {\hideocg*{#1}{\tikz \useasboundingbox (p1) rectangle (p2);}}; + } + } }, actions ocg/.style n args={3}{ postaction={ path picture={ \path let \p1 = (path picture bounding box.south west), - \p2 = (path picture bounding box.north east), - \p3 = (\x2-\x1,\y2-\y1) + \p2 = (path picture bounding box.north east) in - (path picture bounding box.center) - node[inner sep=0pt,anchor=center] - {\actionsocg*{#1}{#2}{#3}{\phantom{\rule{\x3}{\y3}}}}; - }, - }, - }, + coordinate (p1) at (\p1) coordinate (p2) at (\p2) + node[inner sep=0pt,anchor=south west,outer sep=0pt] at (p1) + {\actionsocg*{#1}{#2}{#3}{\tikz \useasboundingbox (p1) rectangle (p2);}}; + } + } + } } |