-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
I think that the latest version of pyluatex (2024/01/07 v0.6.2) adds an empty line at the end of the outputs (in REPL mode).
\documentclass{article}
\usepackage[executable=python.exe]{pyluatex}
\ExplSyntaxOn
\NewDocumentEnvironment{PythonREPL}{ }
{
\PyLTVerbatimEnv
\begin{pythonrepl}
}
{
\end{pythonrepl}
\directlua
{
tex.print("\\begin{verbatim}")
tex.print(pyluatex.get_last_output())
tex.print("-------------------- line~to~show~the~end")
tex.print("\\end{verbatim}")
}
}
\ExplSyntaxOff
\begin{document}
\begin{PythonREPL}
def fact(n) :
p = 1
for i in range(1,n+1):
p = p*i
return p
fact(5)
fact(13)
\end{PythonREPL}
\end{document}
Here is the output (in fact in verbatim font in the PDF).
>>> def fact(n) :
... p = 1
... for i in range(1,n+1):
... p = p*i
... return p
...
>>> fact(5)
120
>>> fact(13)
6227020800
--------------------line to show the end
The blank line before --------------------line to show the end is not expected (afaik).
Metadata
Metadata
Assignees
Labels
No labels