From b14090c9f3c7797e26fed9eb2b83ce144dcb16a3 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 11 Jan 2024 03:01:30 +0000 Subject: CTAN sync 202401110301 --- macros/luatex/latex/pyluatex/pyluatex.lua | 12 ++++++++++-- macros/luatex/latex/pyluatex/pyluatex.pdf | Bin 83317 -> 83317 bytes macros/luatex/latex/pyluatex/pyluatex.sty | 2 +- macros/luatex/latex/pyluatex/pyluatex.tex | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'macros/luatex/latex/pyluatex') diff --git a/macros/luatex/latex/pyluatex/pyluatex.lua b/macros/luatex/latex/pyluatex/pyluatex.lua index 7ec06f8ea6..3540748020 100644 --- a/macros/luatex/latex/pyluatex/pyluatex.lua +++ b/macros/luatex/latex/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/macros/luatex/latex/pyluatex/pyluatex.pdf b/macros/luatex/latex/pyluatex/pyluatex.pdf index c3623287dd..0ad3ce0a45 100644 Binary files a/macros/luatex/latex/pyluatex/pyluatex.pdf and b/macros/luatex/latex/pyluatex/pyluatex.pdf differ diff --git a/macros/luatex/latex/pyluatex/pyluatex.sty b/macros/luatex/latex/pyluatex/pyluatex.sty index 2b0575a830..1f0eb3bd53 100644 --- a/macros/luatex/latex/pyluatex/pyluatex.sty +++ b/macros/luatex/latex/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 diff --git a/macros/luatex/latex/pyluatex/pyluatex.tex b/macros/luatex/latex/pyluatex/pyluatex.tex index 5080c4b52f..15e8c4f9f2 100644 --- a/macros/luatex/latex/pyluatex/pyluatex.tex +++ b/macros/luatex/latex/pyluatex/pyluatex.tex @@ -15,7 +15,7 @@ \usepackage{url} \title{The \emph{pyluatex} package} \author{Tobias Enderle\\\url{https://github.com/tndrle/PyLuaTeX}} -\date{v0.6.2 (2024/01/07)} +\date{v0.6.3 (2024/01/10)} \begin{document} \maketitle \raggedright -- cgit v1.2.3