Ticket #6403 (closed enhancement: fixed)
Custom definitions for latex style
| Reported by: | schymans | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.3.3 |
| Component: | symbolics | Keywords: | latex |
| Cc: | mvngu | Author(s): | |
| Report Upstream: | N/A | Reviewer(s): | |
| Merged in: | Work issues: |
Description (last modified by gmhossain) (diff)
#6290 introduced a way to custom-define the latex style of functions, but it would be great if something similar was made possible for any variable. I used to do it in the following way, but now I get an error message:
sage: var('hi kunsati delyui')
sage: hi._latex_ = lambda: 'h_i'
sage: kunsati._latex_ = lambda: 'K_{unsat,i}'
sage: delyui._latex_ = lambda: '\delta_{yu,i}'
Traceback (most recent call last):
...
AttributeError?: 'sage.symbolic.expression.Expression' object attribute '_latex_' is read-only
Comment by Burcin Erocal on sage-devel (25/06/2006):
Since Expression is a cython class, you cannot overwrite the _latex_() method. Pynac supports setting latex names for variables at creation, but this functionality is not exposed in the wrapper. Another solution by hacking latex_variable_name() might be possible, but I would like to avoid that if possible. Feel free to open a new issue in trac about it. Cheers, Burcin
How could the Pynac funtionality of setting latex names for variables at creation be exposed?
Patches:
Patches that will resolve this ticket is posted at #6559
