On Jul 26, 12:59 pm, Mike Witt <[email protected]> wrote:
> sage: version()
> 'Sage Version 4.5.1, Release Date: 2010-07-19'
>
> I'd like to to define a latex macro, in a worksheet,
> so that I can use it later to do something like this:
>
> html('State = $\\ket{0}$')
>
> I found some documentation, but I'm clearly not understanding 
> it:http://www.sagemath.org/doc/reference/sage/misc/latex.html
>
> I didn't get as far as trying to define 'ket' --
> I'm trying things like the commands below, but apparently
> this isn't right. I don't understand what the "Latex instance"
> is. Can somebody help me out?
>
> sage: sage.misc.latex.Latex.add_macro("\\newcommand{\\foo}{bar}")

Try

sage: latex.add_macro("\\newcommand{\\foo}{bar}")

(just like in the examples in the documentation).

--
John

-- 
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
URL: http://www.sagemath.org

Reply via email to