William, Thanks. That works ok -- except, for example if I do
latex.eval('$N_0$',{})
I get what I expect plus a line with two single quotes before what I
wanted. This seems to happen with any latex string. Do you know
what's happening?
Victor
On Jul 20, 6:58 pm, William Stein <[email protected]> wrote:
> On Mon, Jul 20, 2009 at 3:30 PM, VictorMiller<[email protected]> wrote:
>
> > I have a program which calculates a table of values, and I'd like to
> > display it nicely formatted. I've written a function to produce latex
> > for it (using tabular), but I can't figure out how to get SAGE to
> > display this in a notebook. I've tried the html command but that
> > doesn't work. Here's a small example. I can put the following in a
> > cell:
>
> > %latex
> > \begin{tabular}{c|c} \hline A & B \\ \hline \hline 1 & 2 \\ \hline \end
> > {tabular}
>
> > and it renders as I expect. however, if I put the above latex in a
> > string and try html or view it just spits out the latex (minus the
> > first two characters!).
>
> Try this:
>
> latex.eval(r"""
> \begin{tabular}{c|c} \hline A & B \\ \hline \hline 1 & 2 \\ \hline \end
> {tabular}
> """,{})
>
> In most cases, you can simulate any "%foo" environment in the notebook
> by just typing foo.eval(<input string>, globals()).
>
> William
>
>
>
>
>
> > And incidentally, I can't figure out the following part of the latex
> > documenation since something seems to be missing. Exactly what does
> > the Latex function do?
>
> > class sage.misc.latex.Latex(debug=False, slide=False, density=150,
> > pdflatex=None)¶
>
> > Enter, e.g.,
>
> > %latex
> > The equation $y^2 = x^3 + x$ defines an elliptic curve.
> > We have $2006 = \sage{factor(2006)}$.
>
> > in an input cell in the notebook to get a typeset version. Use
> > %latex_debug to get debugging output.
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---