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}")
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)

/home/mike/<ipython console> in <module>()

TypeError: unbound method add_macro() must be called with Latex instance as first argument (got str instance instead)


sage.misc.latex.Latex.extra_macros()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)

/home/mike/<ipython console> in <module>()

TypeError: unbound method extra_macros() must be called with Latex instance as first argument (got nothing instead)

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to