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.Thu, 10 Nov 2022 18:19:16 +0100LatexExpr and apostrophehttps://ask.sagemath.org/question/64796/latexexpr-and-apostrophe/How to type set apostrophe in this context
show(LatexExpr(r'\text{L' élément}'))
obviously connot work. (I hope not to have already ask the question but I do not know how to find the answer)Thu, 10 Nov 2022 12:18:25 +0100https://ask.sagemath.org/question/64796/latexexpr-and-apostrophe/Comment by Max Alekseyev for <p>How to type set apostrophe in this context</p>
<pre><code>show(LatexExpr(r'\text{L' élément}'))
</code></pre>
<p>obviously connot work. (I hope not to have already ask the question but I do not know how to find the answer)</p>
https://ask.sagemath.org/question/64796/latexexpr-and-apostrophe/?comment=64797#post-id-64797Use double quotes?
show(LatexExpr(r"\text{L' élément}"))Thu, 10 Nov 2022 13:39:54 +0100https://ask.sagemath.org/question/64796/latexexpr-and-apostrophe/?comment=64797#post-id-64797Comment by John Palmieri for <p>How to type set apostrophe in this context</p>
<pre><code>show(LatexExpr(r'\text{L' élément}'))
</code></pre>
<p>obviously connot work. (I hope not to have already ask the question but I do not know how to find the answer)</p>
https://ask.sagemath.org/question/64796/latexexpr-and-apostrophe/?comment=64800#post-id-64800Another option is to use triple quotes: `LatexExpr(r'''\text{L'élément}''')` or `LatexExpr(r"""\text{L'élément}""")`. These are useful if you want to use both `'` and `"` in the string.Thu, 10 Nov 2022 18:19:16 +0100https://ask.sagemath.org/question/64796/latexexpr-and-apostrophe/?comment=64800#post-id-64800Comment by John Palmieri for <p>How to type set apostrophe in this context</p>
<pre><code>show(LatexExpr(r'\text{L' élément}'))
</code></pre>
<p>obviously connot work. (I hope not to have already ask the question but I do not know how to find the answer)</p>
https://ask.sagemath.org/question/64796/latexexpr-and-apostrophe/?comment=64799#post-id-64799If you don't want to use double quotes, then you can "escape" the single quote with a backslash. This means not using the "r" prefix for the string, so that a backslash can still serve as an escape: `LatexExpr('\\text{L\'élément}')`.Thu, 10 Nov 2022 18:17:50 +0100https://ask.sagemath.org/question/64796/latexexpr-and-apostrophe/?comment=64799#post-id-64799