summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzmark
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-09 22:39:32 +0000
committerKarl Berry <karl@freefriends.org>2016-04-09 22:39:32 +0000
commit8b226d155f21235b95e26816b004ea6d3642f339 (patch)
tree8bb2a9ddd917a837cbb494f77105df3ad338dbbc /Master/texmf-dist/tex/latex/tikzmark
parent0ce59d52f60266fe99c400e353e27b3ede248097 (diff)
tikzmark (8apr16)
git-svn-id: svn://tug.org/texlive/trunk@40372 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzmark')
-rw-r--r--Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex68
-rw-r--r--Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex5
2 files changed, 59 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex b/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex
index 0a0a829ec0a..961c3bc731f 100644
--- a/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex
+++ b/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex
@@ -7,7 +7,7 @@
%% tikzmark.dtx (with options: `tikzlibrary')
%% ----------------------------------------------------------------
%% tikzmark --- remembering absolute positioning with TikZ.
-%% E-mail: stacey@math.ntnu.no
+%% E-mail: loopspace@mathforge.org
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
@@ -29,11 +29,11 @@
},
},
save picture id/.code={%
- \immediate\write\pgfutil@auxout{%
- \string\savepointas{#1}{\pgfpictureid}}%
+ \protected@write\pgfutil@auxout{}{%
+ \string\savepointas{\tikzmark@pp@name{#1}}{\pgfpictureid}{0pt}{0pt}}%
},
if picture id/.code args={#1#2#3}{%
- \@ifundefined{save@pt@#1}{%
+ \@ifundefined{save@pt@\tikzmark@pp@name{#1}}{%
\pgfkeysalso{#3}%
}{
\pgfkeysalso{#2}%
@@ -56,15 +56,19 @@
next page/ignore/.style={%
next page vector={\pgfqpoint{0pt}{0pt}}%
},
+ tikzmark prefix/.initial=,%
+ tikzmark suffix/.initial=,%
}
-\def\savepointas#1#2{%
+\def\tikzmark@pp@name#1{\csname pgfk@/tikz/tikzmark prefix\endcsname#1\csname pgfk@/tikz/tikzmark suffix\endcsname}%
+\def\savepointas#1#2#3#4{%
\expandafter\gdef\csname save@pt@#1\endcsname{#2}%
+ \expandafter\gdef\csname save@pt@#1@offset\endcsname{\pgfqpoint{#3}{#4}}%
}
\def\savepicturepage#1#2{%
\expandafter\gdef\csname save@pg@#1\endcsname{#2}%
}
\def\tmk@labeldef#1,#2\@nil{%
- \def\tmk@label{#1}%
+ \edef\tmk@label{\tikzmark@pp@name{#1}}%
\def\tmk@def{#2}%
}
\tikzdeclarecoordinatesystem{pic}{%
@@ -87,6 +91,9 @@
\advance\pgf@y by -\pgf@ya
\pgf@xa=\pgf@x
\pgf@ya=\pgf@y
+ \pgf@process{\pgfpointorigin\csname save@pt@\tmk@label @offset\endcsname}%
+ \advance\pgf@xa by \pgf@x
+ \advance\pgf@ya by \pgf@y
\@ifundefined{save@pg@\csname save@pt@\tmk@label\endcsname}{}{%
\@ifundefined{save@pg@\pgfpictureid}{}{%
\pgfkeysvalueof{/tikz/next page vector}%
@@ -98,10 +105,39 @@
}%
\pgf@x=\pgf@xa
\pgf@y=\pgf@ya
+ \pgftransforminvert
+ \pgf@pos@transform{\pgf@x}{\pgf@y}%
}%
}
-\newcommand\tikzmark[2][]{%
+\begingroup
+\catcode`\;=\active
+\gdef\tikzmark@active#1#2{%
+\tikz[remember picture with id=#2] #1;}
+\endgroup
+\def\tikzmark@nonactive#1#2{%
\tikz[remember picture with id=#2] #1;}
+\newcommand\tikzmark@outside[2][]{%
+ \ifnum\catcode`\;=\active
+ \let\tikzmark@next=\tikzmark@active
+ \else
+ \let\tikzmark@next=\tikzmark@nonactive
+ \fi
+ \tikzmark@next{#1}{#2}%
+}
+\def\tikzmark@inside#1#2{%
+ \tikzset{remember picture}%
+ \tikz@scan@one@point\pgfutil@firstofone#2\relax
+ \protected@write\pgfutil@auxout{}{%
+ \string\savepointas{\tikzmark@pp@name{#1}}{\pgfpictureid}{\the\pgf@x pt}{\the\pgf@y pt}}%
+}
+\def\tikzmark{%
+ \ifx\pgfpictureid\@undefined
+ \let\tikzmark@next=\tikzmark@outside
+ \else
+ \let\tikzmark@next=\tikzmark@inside
+ \fi
+ \tikzmark@next%
+}
\newcommand\pgfmark[1]{%
\bgroup
\global\advance\pgf@picture@serial@count by1\relax%
@@ -111,10 +147,21 @@
\noexpand\write\noexpand\pgfutil@auxout{%
\string\savepicturepage{\pgfpictureid}{\noexpand\thepage}}}%
\pgf@temp
- \immediate\write\pgfutil@auxout{%
- \string\savepointas{#1}{\pgfpictureid}}%
+ \protected@write\pgfutil@auxout{}{%
+ \string\savepointas{\tikzmark@pp@name{#1}}{\pgfpictureid}{0pt}{0pt}}%
\egroup
}
+\@ifclassloaded{beamer}{
+ \renewcommand<>{\tikzmark}[2][]{\only#3{\beameroriginal{\tikzmark}[{#1}]{#2}}}
+}{}
+\@ifclassloaded{beamer}{
+ \renewcommand<>{\pgfmark}[1]{\only#2{\beameroriginal{\pgfmark}{#1}}}
+}{}
+\@ifclassloaded{beamer}{
+ \tikzset{
+ tikzmark suffix=-\the\beamer@slideinframe
+ }
+}{}
\newcommand\iftikzmark[3]{%
\@ifundefined{save@pt@#1}{%
#3%
@@ -199,7 +246,7 @@
}
%%
-%% Copyright (C) 2011 by Andrew Stacey <stacey@math.ntnu.no>
+%% Copyright (C) 2011-2016 by Andrew Stacey <loopspace@mathforge.org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
@@ -216,7 +263,6 @@
%% tikzmark.pdf,
%% tikzlibrarytikzmark.code.tex, and
%% tikzmarklibrarylistings.code.tex
-%% tikzmarklibraryhighlight.code.tex
%%
%%
%% End of file `tikzlibrarytikzmark.code.tex'.
diff --git a/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex b/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex
index a8874dc1daa..940e6dd925e 100644
--- a/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex
+++ b/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex
@@ -7,7 +7,7 @@
%% tikzmark.dtx (with options: `listings')
%% ----------------------------------------------------------------
%% tikzmark --- remembering absolute positioning with TikZ.
-%% E-mail: stacey@math.ntnu.no
+%% E-mail: loopspace@mathforge.org
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
@@ -47,7 +47,7 @@
\PackageError{tikzmark listings}{The listings package has not been loaded.}{}
}
%%
-%% Copyright (C) 2011 by Andrew Stacey <stacey@math.ntnu.no>
+%% Copyright (C) 2011-2016 by Andrew Stacey <loopspace@mathforge.org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
@@ -64,7 +64,6 @@
%% tikzmark.pdf,
%% tikzlibrarytikzmark.code.tex, and
%% tikzmarklibrarylistings.code.tex
-%% tikzmarklibraryhighlight.code.tex
%%
%%
%% End of file `tikzmarklibrarylistings.code.tex'.