summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/python
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-08-05 03:02:12 +0000
committerNorbert Preining <norbert@preining.info>2021-08-05 03:02:12 +0000
commitb7e54219e4294fa527035f0bd2819ca11c3c6964 (patch)
tree6809ec5fe48f0c77fd85957a212fb223c3c3ab10 /macros/latex/contrib/python
parentda02fd6ad1c5fb45c5ec641bf236d8de4745709f (diff)
CTAN sync 202108050302
Diffstat (limited to 'macros/latex/contrib/python')
-rw-r--r--macros/latex/contrib/python/python.sty10
1 files changed, 7 insertions, 3 deletions
diff --git a/macros/latex/contrib/python/python.sty b/macros/latex/contrib/python/python.sty
index 2d08fdf6cd..760476ee53 100644
--- a/macros/latex/contrib/python/python.sty
+++ b/macros/latex/contrib/python/python.sty
@@ -25,8 +25,12 @@
%% no more than 15 \newwrites are allowed (and the previous version created a new
%% every time \@writemodule was called.
+%% 0.21 -> 0.22: Fixed bug where spurious spaces were introduced in the output.
+%% Thanks goes to Gernot Salzer <gernot.salzer@tuwien.ac.at> for pointing out
+%% the bug and providing a patch.
+
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{python}[2007/06/07 v0.21 Python in LaTeX]
+\ProvidesPackage{python}[2021/08/03 v0.22 Python in LaTeX]
\newwrite\@out
\newwrite\@module
@@ -39,7 +43,7 @@
\def\python{\kernel@ifnextchar [{\@python}{\@python[]}}
\def\@python[#1]{%
-\gdef\@pythoninclude{#1}
+\gdef\@pythoninclude{#1}%
\immediate\openout\@out=\jobname.py
\newlinechar='15
\begingroup \catcode`\^^M=12 %
@@ -50,7 +54,7 @@
\endgroup
\immediate\closeout\@out
\@writemodule
-\immediate\write18{cat \@pythoninclude\space\jobname.py | python > \jobname.py.out 2> \jobname.py.err}
+\immediate\write18{cat \@pythoninclude\space\jobname.py | python > \jobname.py.out 2> \jobname.py.err}%
\immediate\input\jobname.py.out}
%\immediate\write{\begin{verbatim}}
%\immediate\input\jobname.py.err