ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 04 Nov 2015 03:24:03 -0600Typeset latex in SMChttp://ask.sagemath.org/question/30345/typeset-latex-in-smc/In the classical Sage notebook there is the "view" command that
can be used to e.g. get a plot of a graph rendered by pdflatex.
Is there an equivalent in SMC?
For example I want the following code to give me a graph plot rendered by pdflatex.
G=graphs.BullGraph()
G.set_latex_options(format='dot2tex', prog='dot')
view(G)
I can get the corresponding latex code in SMC by
latex(G)
but I have no idea how to render it.Thu, 29 Oct 2015 11:28:20 -0500http://ask.sagemath.org/question/30345/typeset-latex-in-smc/Answer by eric_g for <p>In the classical Sage notebook there is the "view" command that
can be used to e.g. get a plot of a graph rendered by pdflatex.
Is there an equivalent in SMC?</p>
<p>For example I want the following code to give me a graph plot rendered by pdflatex.</p>
<pre><code>G=graphs.BullGraph()
G.set_latex_options(format='dot2tex', prog='dot')
view(G)
</code></pre>
<p>I can get the corresponding latex code in SMC by </p>
<pre><code>latex(G)
</code></pre>
<p>but I have no idea how to render it.</p>
http://ask.sagemath.org/question/30345/typeset-latex-in-smc/?answer=30452#post-id-30452Thanks to some recent change by William Stein, the command `view(G)` does just work now in the SMC; see [here](https://cloud.sagemath.com/projects/740842ce-7e8a-4173-bf58-abc0b9303aec/files/2015-11-04-101458.sagews) for your example.Wed, 04 Nov 2015 03:24:03 -0600http://ask.sagemath.org/question/30345/typeset-latex-in-smc/?answer=30452#post-id-30452Answer by Jeremias Epperlein for <p>In the classical Sage notebook there is the "view" command that
can be used to e.g. get a plot of a graph rendered by pdflatex.
Is there an equivalent in SMC?</p>
<p>For example I want the following code to give me a graph plot rendered by pdflatex.</p>
<pre><code>G=graphs.BullGraph()
G.set_latex_options(format='dot2tex', prog='dot')
view(G)
</code></pre>
<p>I can get the corresponding latex code in SMC by </p>
<pre><code>latex(G)
</code></pre>
<p>but I have no idea how to render it.</p>
http://ask.sagemath.org/question/30345/typeset-latex-in-smc/?answer=30348#post-id-30348To answer my own question for future reference:
Use
latex.eval(latex(G))
But this only works in SMC.Thu, 29 Oct 2015 11:48:16 -0500http://ask.sagemath.org/question/30345/typeset-latex-in-smc/?answer=30348#post-id-30348