Skip to content

Custom definitions for latex style #6403

@sagetrac-schymans

Description

@sagetrac-schymans

#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

CC: @sagetrac-mvngu

Component: symbolics

Keywords: latex

Issue created by migration from https://trac.sagemath.org/ticket/6403

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions