summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty')
-rw-r--r--Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty19
1 files changed, 12 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty
index b9ce3f97179..0709ba76000 100644
--- a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty
+++ b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty
@@ -9,7 +9,7 @@
%% version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{pyluatex}[2021/07/15 v0.1.3 Execute Python code on the fly]
+\ProvidesPackage{pyluatex}[2021/07/26 v0.2.0 Execute Python code on the fly]
\RequirePackage{expl3}
\ExplSyntaxOn
@@ -30,17 +30,22 @@
\directlua{pyluatex.start([==[\pyluatex@executable]==])}
-\newenvironment{python}{\directlua{pyluatex.record_env()}}%
+\newenvironment{python}{\directlua{pyluatex.record_env(false)}}%
{\directlua{pyluatex.print_env()}}
-\newcommand*{\py}[1]{%
-\directlua{pyluatex.execute([==[print(str(#1), end='')]==], true)}%
-}
+\newenvironment{pythonq}{\directlua{pyluatex.record_env(true)}}{}
+
+\newcommand*{\python@inline}[3]{\directlua{pyluatex.execute([==[#1]==], #2, #3)}}
+
+\newcommand*{\py}[1]{\python@inline{#1}{true}{true}}
+\newcommand*{\pyq}[1]{\python@inline{#1}{true}{false}}
-\newcommand*{\pyc}[1]{\directlua{pyluatex.execute([==[#1]==], true)}}
+\newcommand*{\pyc}[1]{\python@inline{#1}{false}{true}}
+\newcommand*{\pycq}[1]{\python@inline{#1}{false}{false}}
\newcommand*{\pysession}[1]{\directlua{pyluatex.session = [==[#1]==]}}
-\newcommand*{\pyfile}[1]{\directlua{pyluatex.run_file([==[#1]==])}}
+\newcommand*{\pyfile}[1]{\directlua{pyluatex.run_file([==[#1]==], true)}}
+\newcommand*{\pyfileq}[1]{\directlua{pyluatex.run_file([==[#1]==], false)}}
\endinput