-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi,
the following code as an issue together with the function testmod of doctest module (a space is missing in (2,5)). I get the issue with a classical IDE, but not with latex/pyluatex.
Thanks, and merry Christmas !
\documentclass[11pt]{article}
\usepackage{xcolor}
\usepackage{piton}
\usepackage{pyluatex}
\NewDocumentEnvironment { PitonREPL } { !O{ } } % le ! est obligatoire
{
\PyLTVerbatimEnv
\begin{pythonrepl}
}
{
\directlua
{
tex.print("\\begin{Piton}")
tex.print(pyluatex.get_last_output())
tex.print("\\end{Piton}")
tex.print("")
}
\end{pythonrepl}
}
\begin{document}
\begin{python}
import doctest
def division(a: int, b: int) -> (int, int):
"""
>>> division(19, 7)
(2,5)
"""
if (a<0) or (b<=0):
return None
q, r = 0, a
while r >= b:
q += 1
r -= b # bq+r = b(q+1) + (r-b)
return (q, r)
\end{python}
\begin{PitonREPL}
doctest.testmod()
\end{PitonREPL}
\end{document}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels