diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty index 4d8325c8078..6e287e51000 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}[2022/03/16 v0.4.4 Execute Python code on the fly] +\ProvidesPackage{pyluatex}[2022/06/05 v0.5.0 Execute Python code on the fly] \RequirePackage{expl3} \ExplSyntaxOn @@ -66,7 +66,7 @@ \newenvironment{pythonrepl}{\directlua{pyluatex.record_env("pythonrepl", true)}}{} -\newcommand*{\pyluatex@inline}[3]{\directlua{pyluatex.execute([==[#1]==], #2, #3, false)}} +\newcommand*{\pyluatex@inline}[3]{\directlua{pyluatex.execute([==[#1]==], #2, #3, false, true)}} \newcommand*{\py}[1]{\pyluatex@inline{#1}{true}{true}} \newcommand*{\pyq}[1]{\pyluatex@inline{#1}{true}{false}} @@ -81,4 +81,11 @@ \newcommand*{\pyfileq}[1]{\directlua{pyluatex.run_file([==[#1]==], false, false)}} \newcommand*{\pyfilerepl}[1]{\directlua{pyluatex.run_file([==[#1]==], false, true)}} +\newcommand*{\pyif}[1]{% + \ifnum1=\directlua{pyluatex.execute([==['1' if (#1) else '0']==], true, true, false, false)}\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} + \endinput |