ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 14 Sep 2014 22:42:39 +0200Variant Greek letters in "latex_name"https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/Is it possible to get variant Greek letters (\varepsilon, \varkappa etc) when I declare variables?
This:
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.Fri, 12 Sep 2014 23:19:30 +0200https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/Answer by dazedANDconfused for <p>Is it possible to get variant Greek letters (\varepsilon, \varkappa etc) when I declare variables?</p>
<p>This:</p>
<pre><code>e = var('e', latex_name='\epsilon')
</code></pre>
<p>works as expected. But when I am trying:</p>
<pre><code>e = var('e', latex_name='\varepsilon')
</code></pre>
<p>I am seeing unexpeted "arepsilon" when I do show(e).</p>
<p>I am using Sagemath Cloud.</p>
https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/?answer=24109#post-id-24109Sometimes in Sage you need two \ marks. Try this:
e = var('e', latex_name='\\varepsilon')
show(e)
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.Sat, 13 Sep 2014 01:01:45 +0200https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/?answer=24109#post-id-24109Comment by Anton Babkin for <p>Sometimes in Sage you need two \ marks. Try this:</p>
<pre><code>e = var('e', latex_name='\\varepsilon')
show(e)
</code></pre>
<p>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.</p>
https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/?comment=24119#post-id-24119Thanks, this solves my problem!Sun, 14 Sep 2014 22:41:36 +0200https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/?comment=24119#post-id-24119Answer by William Stein for <p>Is it possible to get variant Greek letters (\varepsilon, \varkappa etc) when I declare variables?</p>
<p>This:</p>
<pre><code>e = var('e', latex_name='\epsilon')
</code></pre>
<p>works as expected. But when I am trying:</p>
<pre><code>e = var('e', latex_name='\varepsilon')
</code></pre>
<p>I am seeing unexpeted "arepsilon" when I do show(e).</p>
<p>I am using Sagemath Cloud.</p>
https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/?answer=24112#post-id-24112 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...Sun, 14 Sep 2014 02:01:42 +0200https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/?answer=24112#post-id-24112Comment by Anton Babkin for <p>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</p>
<pre><code>e = var('e', latex_name=r'\varepsilon')
</code></pre>
<p>You'll see this r frequently in the Sage source code for the docstrings of functions...</p>
https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/?comment=24120#post-id-24120Thanks, good to know another way of doing it.Sun, 14 Sep 2014 22:42:39 +0200https://ask.sagemath.org/question/24108/variant-greek-letters-in-latex_name/?comment=24120#post-id-24120