diff options
author | Karl Berry <karl@freefriends.org> | 2024-11-18 21:05:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-11-18 21:05:35 +0000 |
commit | f9ab2dcc4bb0c32487d3c9ee992cd1642dd76c0e (patch) | |
tree | 476545b254a6a3616e621ce18482a6ccfc5d7c91 /Master/texmf-dist/tex/latex/latex2pydata | |
parent | f901f14ea4e7a758873463e6a86c4ba9cdfa3aed (diff) |
latex2pydata (18nov24)
git-svn-id: svn://tug.org/texlive/trunk@72886 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/latex2pydata')
-rw-r--r-- | Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty b/Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty index 2c5360fa948..c7ca945dc3b 100644 --- a/Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty +++ b/Master/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty @@ -20,7 +20,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{latex2pydata} - [2024/10/16 v0.3.0 latex2pydata - write data to file in Python literal format] + [2024/11/17 v0.4.0 latex2pydata - write data to file in Python literal format] \def\pydata@error#1{% \PackageError{latex2pydata}{#1}{}% \batchmode\read -1 to \pydata@exitnow} @@ -155,8 +155,7 @@ \else \pydata@error{Unknown file name "#1"}% \fi} -\newcounter{pydata@bufferindex} -\setcounter{pydata@bufferindex}{0} +\def\pydata@bufferindex{0} \def\pydatasetbuffername#1{% \ifbool{pydata@bufferhaskey}% {\pydata@error{Cannot change buffers when a buffered key is waiting for a value}}% @@ -181,27 +180,27 @@ {\pydata@error{Cannot write buffer when file has a key waiting for a value}}{}% \ifbool{pydata@bufferhaskey}% {\pydata@error{Cannot write buffer when a buffered key is waiting for a value}}{}% - \setcounter{pydata@bufferindex}{1}% - \loop\unless\ifnum\value{pydata@bufferindex}>\pydata@bufferlengthmacro\relax + \gdef\pydata@bufferindex{1}% + \loop\unless\ifnum\pydata@bufferindex>\pydata@bufferlengthmacro\relax \immediate\write\pydata@filehandle{% - \csname\pydata@bufferlinename\arabic{pydata@bufferindex}\endcsname}% - \stepcounter{pydata@bufferindex}% + \csname\pydata@bufferlinename\pydata@bufferindex\endcsname}% + \xdef\pydata@bufferindex{\the\numexpr\pydata@bufferindex+1\relax}% \repeat - \setcounter{pydata@bufferindex}{0}} + \gdef\pydata@bufferindex{0}} \def\pydataclearbuffername#1{% \def\pydata@clearbuffername{#1}% \ifcsname#1length\endcsname \else \pydata@error{Buffer #1 does not exist}% \fi - \setcounter{pydata@bufferindex}{1}% - \loop\unless\ifnum\value{pydata@bufferindex}>\csname#1length\endcsname\relax + \gdef\pydata@bufferindex{1}% + \loop\unless\ifnum\pydata@bufferindex>\csname#1length\endcsname\relax \expandafter\global\expandafter\let - \csname#1line\arabic{pydata@bufferindex}\endcsname\pydata@undefined - \stepcounter{pydata@bufferindex}% + \csname#1line\pydata@bufferindex\endcsname\pydata@undefined + \xdef\pydata@bufferindex{\the\numexpr\pydata@bufferindex+1\relax}% \repeat \expandafter\gdef\csname#1length\endcsname{0}% - \setcounter{pydata@bufferindex}{0}% + \gdef\pydata@bufferindex{0}% \ifx\pydata@clearbuffername\pydata@buffername \boolfalse{pydata@bufferhaskey}% \fi} |