Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom definitions for latex style #6403

Closed
sagetrac-schymans mannequin opened this issue Jun 25, 2009 · 4 comments
Closed

Custom definitions for latex style #6403

sagetrac-schymans mannequin opened this issue Jun 25, 2009 · 4 comments

Comments

@sagetrac-schymans
Copy link
Mannequin

sagetrac-schymans mannequin commented Jun 25, 2009

#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

@golam-m-hossain

This comment has been minimized.

@jasongrout
Copy link
Member

comment:2

There is no patch above, though the title said there was a patch.

@sagetrac-schymans
Copy link
Mannequin Author

sagetrac-schymans mannequin commented Nov 10, 2009

comment:3

Supposedly, the patch for #6559 fixes this (see comment added to description). Could you review #6559 instead? Thanks!

Stan

@burcin
Copy link

burcin commented Feb 19, 2010

comment:4

I'm closing this, since #6559 just got merged. It adds a latex_name keyword argument to var(), which is the functionality requested here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants