Ask Your Question

Variant Greek letters in "latex_name"

asked 2014-09-12 23:19:30 +0100

Anton Babkin gravatar image

updated 2014-09-12 23:20:45 +0100

Is it possible to get variant Greek letters (\varepsilon, \varkappa etc) when I declare variables?


e = var('e', latex_name='\epsilon')

works as expected. But when I am trying:

e = var('e', latex_name='\varepsilon')

I am seeing unexpeted "arepsilon" when I do show(e).

I am using Sagemath Cloud.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-14 02:01:42 +0100

William Stein gravatar image

If you make a raw string you never need two backslashes. If you don't, then you may, depending on what is after a backslash. To make a raw string, prefix it with an r, so in this case do

e = var('e', latex_name=r'\varepsilon')

You'll see this r frequently in the Sage source code for the docstrings of functions...

edit flag offensive delete link more


Thanks, good to know another way of doing it.

Anton Babkin gravatar imageAnton Babkin ( 2014-09-14 22:42:39 +0100 )edit

answered 2014-09-13 01:01:45 +0100

dazedANDconfused gravatar image

updated 2014-09-13 01:04:18 +0100

Sometimes in Sage you need two \ marks. Try this:

e = var('e', latex_name='\\varepsilon')

I thought the need for two \ had to do with whether you had a raw text string or not. That doesn't seem to be the case here. Hopefully someone can fill in the details as to why we need two \ marks here and how we know that 2 are needed.

edit flag offensive delete link more


Thanks, this solves my problem!

Anton Babkin gravatar imageAnton Babkin ( 2014-09-14 22:41:36 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-09-12 23:19:30 +0100

Seen: 3,357 times

Last updated: Sep 14 '14