Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions mathics/doc/latex_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
# We keep track of the number of \begin{asy}'s we see so that
# we can assocation asymptote file numbers with where they are
# in the document
asy_count = 0
next_asy_number = 1

ITALIC_RE = re.compile(r"(?s)<(?P<tag>i)>(?P<content>.*?)</(?P=tag)>")

Expand Down Expand Up @@ -565,10 +565,11 @@ def latex(self, doc_data: dict) -> str:

test_text = result["result"]
if test_text: # is not None and result['result'].strip():
if test_text.find("\\begin{asy}") >= 0:
global asy_count
asy_count += 1
text += f"%% mathics-{asy_count}.asy\n"
asy_count = test_text.count("\\begin{asy}")
if asy_count >= 0:
global next_asy_number
text += f"%% mathics-{next_asy_number}.asy\n"
next_asy_number += asy_count

text += "\\begin{testresult}%s\\end{testresult}" % result["result"]
text += "\\end{testcase}"
Expand Down