diff options
author | Norbert Preining <norbert@preining.info> | 2024-01-18 03:01:29 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-01-18 03:01:29 +0000 |
commit | c4dbe7c982d00abf62e9a8927ecdef11521773a8 (patch) | |
tree | 58b814095058ab06b7b49e3ef819293f1e0f9922 /macros/latex/contrib/pythonimmediate/pythonimmediate.sty | |
parent | 4fd81a66c82a2ba8787c6ca78bfcc14820e4017c (diff) |
CTAN sync 202401180301
Diffstat (limited to 'macros/latex/contrib/pythonimmediate/pythonimmediate.sty')
-rw-r--r-- | macros/latex/contrib/pythonimmediate/pythonimmediate.sty | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/macros/latex/contrib/pythonimmediate/pythonimmediate.sty b/macros/latex/contrib/pythonimmediate/pythonimmediate.sty index 4556973831..1e632aba96 100644 --- a/macros/latex/contrib/pythonimmediate/pythonimmediate.sty +++ b/macros/latex/contrib/pythonimmediate/pythonimmediate.sty @@ -1,5 +1,5 @@ % File: pythonimmediate.sty -% Copyright 2022-2023 user202729 +% Copyright 2022-2024 user202729 % % 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 @@ -12,9 +12,10 @@ % % The Current Maintainer of this work is user202729. -\ProvidesExplPackage{pythonimmediate}{2023/03/07}{0.4.0}{Library to run Python code} +\ProvidesExplPackage{pythonimmediate}{2024/01/18}{0.5.0}{Library to run Python code} \RequirePackage{saveenv} +\PassOptionsToPackage{abspath}{currfile} % try to enable abspath if possible (i.e. if package isn't loaded) but otherwise don't give option-clash error \RequirePackage{currfile} \RequirePackage{l3keys2e} \RequirePackage{precattl} @@ -110,11 +111,14 @@ \bool_if:NTF \_pythonimmediate_child_process { \newwrite \_pythonimmediate_write_file - %\immediate\openout \_pythonimmediate_write_file=symlink-to-stderr.txt~ - % tried this method, it seems to work except that it's buffered when stderr is redirected to a file... - \immediate\openout \_pythonimmediate_write_file=|"\_pythonimmediate_python_executable \space \_pythonimmediate_python_flags \space -m ~ pythonimmediate.copy_to_stderr"~ - - + \sys_if_engine_luatex:TF { + % use Lua to write to stderr + \directlua{ (require "pythonimmediate_helper")() } + } { + %\immediate\openout \_pythonimmediate_write_file=symlink-to-stderr.txt~ + % tried this method, it seems to work except that it's buffered when stderr is redirected to a file... + \immediate\openout \_pythonimmediate_write_file=|"\_pythonimmediate_python_executable \space \_pythonimmediate_python_flags \space -m ~ pythonimmediate.copy_to_stderr"~ + } } { \sys_if_engine_luatex:TF { |