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, 09 Jul 2020 01:14:43 +0200how to render a latex string in a notebook cellhttps://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/Say we have a string variable `s = "some context: $x = 3$"`. The string s is rather simple latex, but is not just an equation. I would like to display the typeset version of `s` in a notebook cell, without having to retype the string by hand in the cell. Thanks for any help.Mon, 06 Jul 2020 17:03:24 +0200https://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/Comment by Juanjo for <p>Say we have a string variable <code>s = "some context: $x = 3$"</code>. The string s is rather simple latex, but is not just an equation. I would like to display the typeset version of <code>s</code> in a notebook cell, without having to retype the string by hand in the cell. Thanks for any help.</p>
https://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/?comment=52376#post-id-52376You may be interested in answers to similar questions like [this one](https://ask.sagemath.org/question/47202/latex-text-in-notebook-and-return-lines/?answer=47213#post-id-47213), [this one](https://ask.sagemath.org/question/47978/add-a-text-in-latex-in-front-of-a-result/?answer=50960#post-id-50960), [this one](https://ask.sagemath.org/question/51717/color-in-latex/?answer=51738#post-id-51738) or [this one](https://ask.sagemath.org/question/49446/how-to-print-trailing-spaces/?answer=49469#post-id-49469).Wed, 08 Jul 2020 12:33:35 +0200https://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/?comment=52376#post-id-52376Answer by rburing for <p>Say we have a string variable <code>s = "some context: $x = 3$"</code>. The string s is rather simple latex, but is not just an equation. I would like to display the typeset version of <code>s</code> in a notebook cell, without having to retype the string by hand in the cell. Thanks for any help.</p>
https://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/?answer=52365#post-id-52365You can do:
html(s)
Mon, 06 Jul 2020 22:51:08 +0200https://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/?answer=52365#post-id-52365Comment by jbaxter for <p>You can do:</p>
<pre><code>html(s)
</code></pre>
https://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/?comment=52381#post-id-52381that worked! thank you much!Thu, 09 Jul 2020 01:14:43 +0200https://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/?comment=52381#post-id-52381