diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-10 20:44:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-10 20:44:35 +0000 |
commit | a59b840cf49718e2dbb64368bf413f36b4520f08 (patch) | |
tree | d8fc5c943b2a6c04e2c322d8de2d6cbb64016d8c /Master/texmf-dist/tex/lualatex | |
parent | 2f3c0886ac4aabc4e8ee65183be257ffe9d21e38 (diff) |
pyluatex (10jan24)
git-svn-id: svn://tug.org/texlive/trunk@69372 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua index 7ec06f8ea69..35407480201 100644 --- a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua +++ b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua @@ -67,6 +67,14 @@ local function not_empty(str) return str ~= nil and str ~= "" end +local function split_lines(str) + local lines = str:splitlines() + if lines[#lines] == "" then + table.remove(lines, #lines) + end + return lines +end + function pyluatex.start(executable, local_imports) local script = file.join(folder, "pyluatex-interpreter.py") @@ -130,8 +138,8 @@ function pyluatex.execute(code, auto_print, write, repl_mode, store) repl_mode = repl_mode, ignore_errors = pyluatex.ignore_errors }) - local code_lines = code:splitlines() - local output_lines = resp.output:splitlines() + local code_lines = split_lines(code) + local output_lines = split_lines(resp.output) if store then last_code = code_lines last_output = output_lines diff --git a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty index 2b0575a8301..1f0eb3bd535 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}[2024/01/07 v0.6.2 Execute Python code on the fly] +\ProvidesPackage{pyluatex}[2024/01/10 v0.6.3 Execute Python code on the fly] \RequirePackage{expl3} \ExplSyntaxOn |