Skip to content

\sageexample` inoperative (seems to have trouble finding its output) #49

@EmmanuelCharpentier

Description

@EmmanuelCharpentier

This :

\begin{sageexample}
  a,b=var("a,b")
  T=[["$f$", "$f(a+b)$", "$f(a-b)$"]]
  T.extend([[f, f(a+b).trig_expand(), f(a-b).trig_expand()] for f in[sin, cos, tan]])
  table(T, header_row=True, header_column=True)
\end{sageexample}

fails with the following output :

Traceback (most recent call last):
  File "Tst5.sagetex.sage.py", line 19, in <module>
    """, globals(), locals(), False)
  File "/usr/local/sage-9/local/lib/python3.7/site-packages/sagetex.py", line 167, in doctest
    splitup = self.split_sage_cmds(s)
  File "/usr/local/sage-9/local/lib/python3.7/site-packages/sagetex.py", line 139, in split_sage_cmds
    starts[0] = re.search(prompt, s).start()
AttributeError: 'NoneType' object has no attribute 'start'
Processing Sage code for Tst5.tex...
Sage example 0 (line 25)

**** Error in Sage code on line 32 of Tst5.tex! Traceback follows.

whereas


\begin{sageblock}
  a,b=var("a,b")
  T=[["$f$", "$f(a+b)$", "$f(a-b)$"]]
  T.extend([[f, f(a+b).trig_expand(), f(a-b).trig_expand()] for f in[sin, cos, tan]])
\end{sageblock}

$$\sage{table(T, header_row=True, header_column=True)}$$

succeeds to the expected result.

Minor booboo, but annoying (contradicts the documentation).

HTH,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions