LaTeX output from Python fails

Issue #67 resolved
Andrew Slaughter created an issue

I am attempting to print a UFL equation with latex, but it is throwing an error. The form2latex function seems to be relying on undefined methods from the FormData class.

Here is what I am doing:

Create a Python file from one of the demos, this creates Heat_debug.py

ufl2py demo/Heat.ufl 

Add the following line to the end of this file:

print a.x_repr_latex_()

Running the code yields:

$ ./Heat_debug.py 
Traceback (most recent call last):
  File "./Heat_debug.py", line 40, in <module>
    print a.x_repr_latex_()
  File "/Users/slauae/projects/ufl/ufl/form.py", line 299, in x_repr_latex_
    return "$$%s$$" % ufl2latex(self)
  File "/Users/slauae/projects/ufl/ufl/formatting/ufl2latex.py", line 520, in ufl2latex
    return form2latex(preprocessed_form, form_data)
  File "/Users/slauae/projects/ufl/ufl/formatting/ufl2latex.py", line 420, in form2latex
    formname = formdata.name
AttributeError: 'FormData' object has no attribute 'name'

Comments (3)

  1. Log in to comment