texlive[57843] Master/texmf-dist: tikzmark (22feb21)

commits+karl at tug.org commits+karl at tug.org
Mon Feb 22 22:52:28 CET 2021


Revision: 57843
          http://tug.org/svn/texlive?view=revision&revision=57843
Author:   karl
Date:     2021-02-22 22:52:28 +0100 (Mon, 22 Feb 2021)
Log Message:
-----------
tikzmark (22feb21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tikzmark/tikzmark.pdf
    trunk/Master/texmf-dist/source/latex/tikzmark/tikzmark.dtx
    trunk/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex
    trunk/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/source/latex/tikzmark/tikzmark.ins

Modified: trunk/Master/texmf-dist/doc/latex/tikzmark/tikzmark.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/tikzmark/tikzmark.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tikzmark/tikzmark.dtx	2021-02-22 21:52:11 UTC (rev 57842)
+++ trunk/Master/texmf-dist/source/latex/tikzmark/tikzmark.dtx	2021-02-22 21:52:28 UTC (rev 57843)
@@ -36,7 +36,7 @@
 \endpreamble
 \postamble
 
-Copyright (C) 2011-2018 by Andrew Stacey <loopspace at mathforge.org>
+Copyright (C) 2011-2021 by Andrew Stacey <loopspace at mathforge.org>
 
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License (LPPL), either
@@ -206,7 +206,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{1138}
+% \CheckSum{1178}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -234,18 +234,19 @@
 % \changes{1.6}{2018/10/18}{Added the ability to save node information between runs and between TeX documents}
 % \changes{1.7}{2019/05/07}{Added conditions to test if a tikzmark is on a particular page}
 % \changes{1.8}{2019/10/04}{Fixed some bugs with subnode and tikzmarknode inside maths}
+% \changes{1.10}{2021/02/16}{Tikzmarknode is now prefix and suffix aware, and added a test to see if a picture id has been saved to the aux file for times when pictures are thrown away, eg in AMS's text command}
 %
 % \DoNotIndex{\newcommand,\newenvironment}
 %
+% \GetFileInfo{tikzlibrarytikzmark.code.tex}
 % \providecommand*{\url}{\texttt}
 % \title{The \textsf{tikzmark} package}
 % \author{Andrew Stacey \\ \url{loopspace at mathforge.org}}
-% \date{v1.8~from 2019/10/04}
+% \date{\fileversion~from \filedate}
 %
 %
 % \maketitle
 %
-% 
 % \section{Introduction}
 %
 % The \Verb+\tikzmark+ macro burst onto the scene in a blaze of glory on \href{http://tex.stackexchange.com}{TeX-SX}.
@@ -452,6 +453,23 @@
 % This is the TikZ key that is used by \Verb+\tikzmark+ to actually save the connection between the name and the picture coordinate.
 % It can be used on an arbitrary picture to save its origin as a tikzmark.
 %
+% \item \Verb+/tikz/check picture id+
+%
+% There are circumstances where, behind the scenes, a tikzpicture is actually placed in a box and processed several times (often this involves \Verb+\mathchoice+).
+% In such a situation, when defining nodes then the last one ``wins'' in that each node remembers the id of the last processed picture.
+% However, only the one that is actually used has its location remembered on the page (since the others don't have a position).
+% This can lead to the situation whereby a node becomes disassociated from its picture and so using it for later reference fails.
+% This key tries to get around that situation by checking the \Verb+aux+ file to see if the current picture was actually typeset last time (by checking for the presence of the remembered location) and if it find that it wasn't, it quietly appends the string \Verb+discard-+ to each node name.
+% The idea being that the version of the picture that is actually typeset will not have this happen and so its nodes ``survive''.
+%
+% \item \Verb+/tikz/maybe define node=#1+
+%
+% The previous key can lead to undefined nodes on the first time that the picture is processed.
+% Using this key will ensure that the specified node is aliased to its \Verb+discard-+ version providing it doesn't already exist.
+% This is purely to get rid of pointless error messages, and also should only be used in conjunction with \Verb+check picture id+.
+%
+% Note that due to the order in which code gets executed, \Verb+check picture id+ should be before any \Verb+maybe define node+ keys.
+%
 % \item \Verb+/tikz/if picture id=#1#2#3+
 %
 % This is a key equivalent of the \Verb+\iftikzmark+ command.
@@ -791,6 +809,10 @@
 %
 % The \Verb+save nodes+ code uses \LaTeX3.
 %    \begin{macrocode}
+\ProvidesFile{tikzlibrarytikzmark.code.tex}[%
+  2021/02/16
+  v1.10
+  TikZ library for marking positions in a document]
 \RequirePackage{expl3, l3keys2e, xparse}
 %    \end{macrocode}
 %
@@ -819,6 +841,44 @@
     },
   },
 %    \end{macrocode}
+% There are times when some code is executed and then discarded, such as in \Verb+\mathchoice+.
+% This can seriously mess with how TikZ pictures are remembered as the last \Verb+pgfpictureid+ to be \emph{processed} is the one that is used, but it is the one that is \emph{used} that is recorded in the \Verb+aux+ file.
+% This isn't particularly a tikzmark issue, but does come up from time to time with tikzmark as it's all about remembering locations.
+%
+% In actual fact, it only occurs with \Verb+\tikzmarknode+ since the issue is about how nodes are associated with pictures.
+%
+% The solution is to check to see if the \Verb+pgfpictureid+ has been recorded in the \Verb+aux+ file and if it hasn't, quietly prefix the node names with a discard term.
+% This needs to be used \emph{after} \Verb+remember picture+ has been invoked.
+% It probably messes with some other stuff so should only be used under controlled conditions, such as \Verb+\tikzmarknode+.
+%    \begin{macrocode}
+  check picture id/.code={
+    \ifpgfrememberpicturepositiononpage
+    \@ifundefined{pgf at sys@pdf at mark@pos@\pgfpictureid}{%
+      \tikzset{%
+        name prefix/.get=\tzmk at name@prefix,
+        name prefix/.prefix=discard-,
+        execute at end picture={%
+          \tikzset{name prefix/.expand once=\tzmk at name@prefix}%
+        },
+      }%
+    }{}%
+    \fi
+  },
+%    \end{macrocode}
+% We also want a failsafe that quietly handles the case where the document hasn't been compiled enough times (once) to get the information into the \Verb+aux+ file.
+% There will already be messages about needing reruns so we don't need to add to that.
+% We simply ensure that the node exists.
+%    \begin{macrocode}
+  maybe define node/.style={%
+    execute at end picture={%
+      \ifpgfrememberpicturepositiononpage
+      \@ifundefined{pgf at sh@pi@\tikz at pp@name{#1}}{%
+        \pgfnodealias{\tikz at pp@name{#1}}{discard-\tikz at pp@name{#1}}%
+      }{}%
+      \fi
+    }%
+  },
+%    \end{macrocode}
 % The positions are already recorded in the \Verb+aux+ file, all we really need to do is provide them with better names.
 %    \begin{macrocode}
   save picture id/.code={%
@@ -860,10 +920,14 @@
     \@ifundefined{save at pt@\tikzmark at pp@name{#1}}{%
       \pgfkeysalso{#3}%
     }{%
-      \@ifundefined{save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname}{%
+      \@ifundefined{%
+        save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname
+      }{%
         \pgfkeysalso{#3}%
       }{%
-        \ifnum\csname save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname\endcsname=\the\value{page}\relax%
+        \ifnum\csname save at pg@%
+        \csname save at pt@\tikzmark at pp@name{#1}\endcsname%
+        \endcsname=\the\value{page}\relax%
         \pgfkeysalso{#2}%
         \else
         \pgfkeysalso{#3}%
@@ -875,10 +939,14 @@
     \@ifundefined{save at pt@\tikzmark at pp@name{#1}}{%
       \pgfkeysalso{#4}%
     }{%
-      \@ifundefined{save at pg@\csname save at pt@\tikzmark at pp@name{#1}@label\endcsname}{%
+      \@ifundefined{%
+        save at pg@\csname save at pt@\tikzmark at pp@name{#1}@label\endcsname%
+      }{%
         \pgfkeysalso{#4}%
       }{%
-        \ifnum\csname save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname\endcsname=#2\relax%
+        \ifnum\csname save at pg@%
+        \csname save at pt@\tikzmark at pp@name{#1}\endcsname%
+        \endcsname=#2\relax%
         \pgfkeysalso{#3}%
         \else
         \pgfkeysalso{#4}%
@@ -969,7 +1037,12 @@
       \@ifundefined{save at pg@\csname save at pt@\tmk at label\endcsname}{}{%
         \@ifundefined{save at pg@\pgfpictureid}{}{%
           \pgfkeysvalueof{/tikz/next page vector}%
-        \edef\tmk at pg{\the\numexpr \csname save at pg@\csname save at pt@\tmk at label\endcsname\endcsname - \csname save at pg@\pgfpictureid\endcsname\relax}%
+        \edef\tmk at pg{%
+          \the\numexpr \csname save at pg@%
+          \csname save at pt@\tmk at label\endcsname\endcsname%
+          -
+          \csname save at pg@\pgfpictureid\endcsname\relax%
+        }%
         \ifnum \tmk at pg > 0 \relax
         \advance \pgf at xa by \pgf at x\relax
         \advance \pgf at ya by \pgf at y\relax
@@ -995,6 +1068,7 @@
 % This version is for when we're outside a tikzpicture environment
 %    \begin{macrocode}
 \newcommand\tikzmark at outside[2][]{%
+\tikzset{external/export next/.try=false}%
 \tikz[remember picture with id=#2]{#1}%
 }
 %    \end{macrocode}
@@ -1004,7 +1078,8 @@
   \tikzset{remember picture}%
   \tikz at scan@one at point\pgfutil at firstofone#2\relax
   \protected at write\pgfutil at auxout{}{%
-    \string\savepointas{\tikzmark at pp@name{#1}}{\pgfpictureid}{\the\pgf at x}{\the\pgf at y}}%
+    \string\savepointas%
+    {\tikzmark at pp@name{#1}}{\pgfpictureid}{\the\pgf at x}{\the\pgf at y}}%
 }
 %    \end{macrocode}
 % And finally, the ultimate invoker:
@@ -1111,7 +1186,9 @@
     \@ifundefined{save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname}{%
       \tikzmark at false
     }{%
-      \ifnum\csname save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname\endcsname=#2\relax%
+      \ifnum\csname save at pg@%
+      \csname save at pt@\tikzmark at pp@name{#1}\endcsname%
+      \endcsname=#2\relax%
       \tikzmark at true
       \else
       \tikzmark at false
@@ -1132,7 +1209,9 @@
     \@ifundefined{save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname}{%
       \tikzmark at false
     }{%
-      \ifnum\csname save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname\endcsname=\the\value{page}\relax%
+      \ifnum\csname save at pg@%
+      \csname save at pt@\tikzmark at pp@name{#1}\endcsname%
+      \endcsname=\the\value{page}\relax%
       \tikzmark at true
       \else
       \tikzmark at false
@@ -1252,10 +1331,13 @@
 % It does its best to work inside a math environment by a sneaky trick involving \Verb+\mathchoice+: the \Verb+remember picture+ key means that only the picture id of the typeset box is saved to the aux file.  So comparing the possible picture ids of the four options with the one read from the aux file, we can figure out which box was actually used.
 %    \begin{macrocode}
 \def\tikzmarknode@#1#2#3{%
+\tikzset{external/export next/.try=false}%
   \tikz[%
     remember picture,
+    save picture id={#2},
+    check picture id,
+    maybe define node={#2},
     baseline=(#2.base),
-    save picture id={#2},
     every tikzmarknode picture/.try
   ] {
     \node[
@@ -1290,25 +1372,25 @@
   \expandafter\ifx\csname\tzmk at pic\endcsname\relax
 \edef\tzmk at pic{\tzmk at prfx\the\numexpr\the\pgf at picture@serial at count-3\relax}%
   \expandafter\ifx\csname\tzmk at pic\endcsname\relax
-  \pgfutil at ifundefined{pgf at sh@ns@#2}{%
-    \pgfnodealias{#2}{#2-t}%
-    \tikzmarkalias{#2}{#2-t}%
+  \pgfutil at ifundefined{pgf at sh@ns@\tikz at pp@name{#2}}{%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-t}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-t}}%
   }{}%
   \else
-    \pgfnodealias{#2}{#2-d}%
-    \tikzmarkalias{#2}{#2-d}%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-d}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-d}}%
   \fi
   \else
-    \pgfnodealias{#2}{#2-t}%
-    \tikzmarkalias{#2}{#2-t}%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-t}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-t}}%
   \fi
   \else
-    \pgfnodealias{#2}{#2-s}%
-    \tikzmarkalias{#2}{#2-s}%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-s}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-s}}%
   \fi
   \else
-    \pgfnodealias{#2}{#2-ss}%
-    \tikzmarkalias{#2}{#2-ss}%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-ss}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-ss}}%
   \fi
   \else
     \tikzmarknode@{#1}{#2}{#3}%
@@ -1886,8 +1968,10 @@
 %
 % \begin{macro}{\iflst at linemark}
 % A conditional to help with placing the mark at the first non-whitespace character.
+% Should be set to true so that we notice the first line of the code.
 %    \begin{macrocode}
-    \newif\iflst at linemark
+  \newif\iflst at linemark
+  \lst at linemarktrue
 %    \end{macrocode}
 % \end{macro}
 %

Deleted: trunk/Master/texmf-dist/source/latex/tikzmark/tikzmark.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/tikzmark/tikzmark.ins	2021-02-22 21:52:11 UTC (rev 57842)
+++ trunk/Master/texmf-dist/source/latex/tikzmark/tikzmark.ins	2021-02-22 21:52:28 UTC (rev 57843)
@@ -1,76 +0,0 @@
-%%
-%% This is file `tikzmark.ins',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% tikzmark.dtx  (with options: `install')
-%% ----------------------------------------------------------------
-%% tikzmark --- remembering absolute positioning with TikZ.
-%% E-mail: loopspace at mathforge.org
-%% Released under the LaTeX Project Public License v1.3c or later
-%% See http://www.latex-project.org/lppl.txt
-%% ----------------------------------------------------------------
-%% 
-\input docstrip.tex
-\keepsilent
-\askforoverwritefalse
-\preamble
-----------------------------------------------------------------
-tikzmark --- remembering absolute positioning with TikZ.
-E-mail: loopspace at mathforge.org
-Released under the LaTeX Project Public License v1.3c or later
-See http://www.latex-project.org/lppl.txt
-----------------------------------------------------------------
-
-\endpreamble
-\postamble
-
-Copyright (C) 2011-2018 by Andrew Stacey <loopspace at mathforge.org>
-
-This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License (LPPL), either
-version 1.3c of this license or (at your option) any later
-version.  The latest version of this license is in the file:
-
-http://www.latex-project.org/lppl.txt
-
-This work is "maintained" (as per LPPL maintenance status) by
-Andrew Stacey.
-
-This work consists of the file  tikzmark.dtx
-and the derived files           tikzmark.ins,
-                                tikzmark.pdf,
-                                tikzlibrarytikzmark.code.tex, and
-                                tikzmarklibrarylistings.code.tex
-
-\endpostamble
-\usedir{tex/latex/tikzmark}
-\generate{
-  \file{tikzlibrarytikzmark.code.tex}{\from{\jobname.dtx}{tikzlibrary}}
-}
-\generate{
-  \file{tikzmarklibrarylistings.code.tex}{\from{\jobname.dtx}{listings}}
-}
-\endbatchfile
-%% 
-%% Copyright (C) 2011-2018 by Andrew Stacey <loopspace at mathforge.org>
-%% 
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License (LPPL), either
-%% version 1.3c of this license or (at your option) any later
-%% version.  The latest version of this license is in the file:
-%% 
-%% http://www.latex-project.org/lppl.txt
-%% 
-%% This work is "maintained" (as per LPPL maintenance status) by
-%% Andrew Stacey.
-%% 
-%% This work consists of the file  tikzmark.dtx
-%% and the derived files           tikzmark.ins,
-%%                                 tikzmark.pdf,
-%%                                 tikzlibrarytikzmark.code.tex, and
-%%                                 tikzmarklibrarylistings.code.tex
-%% 
-%%
-%% End of file `tikzmark.ins'.

Modified: trunk/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex	2021-02-22 21:52:11 UTC (rev 57842)
+++ trunk/Master/texmf-dist/tex/latex/tikzmark/tikzlibrarytikzmark.code.tex	2021-02-22 21:52:28 UTC (rev 57843)
@@ -12,6 +12,10 @@
 %% See http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
 %% 
+\ProvidesFile{tikzlibrarytikzmark.code.tex}[%
+  2021/02/16
+  v1.10
+  TikZ library for marking positions in a document]
 \RequirePackage{expl3, l3keys2e, xparse}
 \tikzset{%
   remember picture with id/.style={%
@@ -32,6 +36,28 @@
       \fi%
     },
   },
+  check picture id/.code={
+    \ifpgfrememberpicturepositiononpage
+    \@ifundefined{pgf at sys@pdf at mark@pos@\pgfpictureid}{%
+      \tikzset{%
+        name prefix/.get=\tzmk at name@prefix,
+        name prefix/.prefix=discard-,
+        execute at end picture={%
+          \tikzset{name prefix/.expand once=\tzmk at name@prefix}%
+        },
+      }%
+    }{}%
+    \fi
+  },
+  maybe define node/.style={%
+    execute at end picture={%
+      \ifpgfrememberpicturepositiononpage
+      \@ifundefined{pgf at sh@pi@\tikz at pp@name{#1}}{%
+        \pgfnodealias{\tikz at pp@name{#1}}{discard-\tikz at pp@name{#1}}%
+      }{}%
+      \fi
+    }%
+  },
   save picture id/.code={%
       \protected at write\pgfutil at auxout{}{%
       \string\savepointas%
@@ -65,10 +91,14 @@
     \@ifundefined{save at pt@\tikzmark at pp@name{#1}}{%
       \pgfkeysalso{#3}%
     }{%
-      \@ifundefined{save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname}{%
+      \@ifundefined{%
+        save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname
+      }{%
         \pgfkeysalso{#3}%
       }{%
-        \ifnum\csname save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname\endcsname=\the\value{page}\relax%
+        \ifnum\csname save at pg@%
+        \csname save at pt@\tikzmark at pp@name{#1}\endcsname%
+        \endcsname=\the\value{page}\relax%
         \pgfkeysalso{#2}%
         \else
         \pgfkeysalso{#3}%
@@ -80,10 +110,14 @@
     \@ifundefined{save at pt@\tikzmark at pp@name{#1}}{%
       \pgfkeysalso{#4}%
     }{%
-      \@ifundefined{save at pg@\csname save at pt@\tikzmark at pp@name{#1}@label\endcsname}{%
+      \@ifundefined{%
+        save at pg@\csname save at pt@\tikzmark at pp@name{#1}@label\endcsname%
+      }{%
         \pgfkeysalso{#4}%
       }{%
-        \ifnum\csname save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname\endcsname=#2\relax%
+        \ifnum\csname save at pg@%
+        \csname save at pt@\tikzmark at pp@name{#1}\endcsname%
+        \endcsname=#2\relax%
         \pgfkeysalso{#3}%
         \else
         \pgfkeysalso{#4}%
@@ -143,7 +177,12 @@
       \@ifundefined{save at pg@\csname save at pt@\tmk at label\endcsname}{}{%
         \@ifundefined{save at pg@\pgfpictureid}{}{%
           \pgfkeysvalueof{/tikz/next page vector}%
-        \edef\tmk at pg{\the\numexpr \csname save at pg@\csname save at pt@\tmk at label\endcsname\endcsname - \csname save at pg@\pgfpictureid\endcsname\relax}%
+        \edef\tmk at pg{%
+          \the\numexpr \csname save at pg@%
+          \csname save at pt@\tmk at label\endcsname\endcsname%
+          -
+          \csname save at pg@\pgfpictureid\endcsname\relax%
+        }%
         \ifnum \tmk at pg > 0 \relax
         \advance \pgf at xa by \pgf at x\relax
         \advance \pgf at ya by \pgf at y\relax
@@ -161,6 +200,7 @@
   }%
 }
 \newcommand\tikzmark at outside[2][]{%
+\tikzset{external/export next/.try=false}%
 \tikz[remember picture with id=#2]{#1}%
 }
 \def\tikzmark at inside#1#2{%
@@ -167,7 +207,8 @@
   \tikzset{remember picture}%
   \tikz at scan@one at point\pgfutil at firstofone#2\relax
   \protected at write\pgfutil at auxout{}{%
-    \string\savepointas{\tikzmark at pp@name{#1}}{\pgfpictureid}{\the\pgf at x}{\the\pgf at y}}%
+    \string\savepointas%
+    {\tikzmark at pp@name{#1}}{\pgfpictureid}{\the\pgf at x}{\the\pgf at y}}%
 }
 \def\tikzmark{%
   \ifx\pgfpictureid\@undefined
@@ -234,7 +275,9 @@
     \@ifundefined{save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname}{%
       \tikzmark at false
     }{%
-      \ifnum\csname save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname\endcsname=#2\relax%
+      \ifnum\csname save at pg@%
+      \csname save at pt@\tikzmark at pp@name{#1}\endcsname%
+      \endcsname=#2\relax%
       \tikzmark at true
       \else
       \tikzmark at false
@@ -250,7 +293,9 @@
     \@ifundefined{save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname}{%
       \tikzmark at false
     }{%
-      \ifnum\csname save at pg@\csname save at pt@\tikzmark at pp@name{#1}\endcsname\endcsname=\the\value{page}\relax%
+      \ifnum\csname save at pg@%
+      \csname save at pt@\tikzmark at pp@name{#1}\endcsname%
+      \endcsname=\the\value{page}\relax%
       \tikzmark at true
       \else
       \tikzmark at false
@@ -356,10 +401,13 @@
 }
 
 \def\tikzmarknode@#1#2#3{%
+\tikzset{external/export next/.try=false}%
   \tikz[%
     remember picture,
+    save picture id={#2},
+    check picture id,
+    maybe define node={#2},
     baseline=(#2.base),
-    save picture id={#2},
     every tikzmarknode picture/.try
   ] {
     \node[
@@ -394,25 +442,25 @@
   \expandafter\ifx\csname\tzmk at pic\endcsname\relax
 \edef\tzmk at pic{\tzmk at prfx\the\numexpr\the\pgf at picture@serial at count-3\relax}%
   \expandafter\ifx\csname\tzmk at pic\endcsname\relax
-  \pgfutil at ifundefined{pgf at sh@ns@#2}{%
-    \pgfnodealias{#2}{#2-t}%
-    \tikzmarkalias{#2}{#2-t}%
+  \pgfutil at ifundefined{pgf at sh@ns@\tikz at pp@name{#2}}{%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-t}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-t}}%
   }{}%
   \else
-    \pgfnodealias{#2}{#2-d}%
-    \tikzmarkalias{#2}{#2-d}%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-d}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-d}}%
   \fi
   \else
-    \pgfnodealias{#2}{#2-t}%
-    \tikzmarkalias{#2}{#2-t}%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-t}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-t}}%
   \fi
   \else
-    \pgfnodealias{#2}{#2-s}%
-    \tikzmarkalias{#2}{#2-s}%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-s}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-s}}%
   \fi
   \else
-    \pgfnodealias{#2}{#2-ss}%
-    \tikzmarkalias{#2}{#2-ss}%
+    \pgfnodealias{\tikz at pp@name{#2}}{\tikz at pp@name{#2-ss}}%
+    \tikzmarkalias{\tikzmark at pp@name{#2}}{\tikzmark at pp@name{#2-ss}}%
   \fi
   \else
     \tikzmarknode@{#1}{#2}{#3}%
@@ -772,7 +820,7 @@
 }
 \ExplSyntaxOff
 %% 
-%% Copyright (C) 2011-2018 by Andrew Stacey <loopspace at mathforge.org>
+%% Copyright (C) 2011-2021 by Andrew Stacey <loopspace at mathforge.org>
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License (LPPL), either

Modified: trunk/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex	2021-02-22 21:52:11 UTC (rev 57842)
+++ trunk/Master/texmf-dist/tex/latex/tikzmark/tikzmarklibrarylistings.code.tex	2021-02-22 21:52:28 UTC (rev 57843)
@@ -13,7 +13,8 @@
 %% ----------------------------------------------------------------
 %% 
 \@ifpackageloaded{listings}{%
-    \newif\iflst at linemark
+  \newif\iflst at linemark
+  \lst at linemarktrue
 \lst at AddToHook{EveryLine}{%
   \begingroup
   \advance\c at lstnumber by 1\relax
@@ -47,7 +48,7 @@
     \PackageError{tikzmark listings}{The listings package has not been loaded.}{}
 }
 %% 
-%% Copyright (C) 2011-2018 by Andrew Stacey <loopspace at mathforge.org>
+%% Copyright (C) 2011-2021 by Andrew Stacey <loopspace at mathforge.org>
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License (LPPL), either



More information about the tex-live-commits mailing list.