Closed 85eec1a4-3d04-4b4d-b711-d4db03337c41 closed 15 years ago
Here's an attempt at this. To use it:
sage: latex.add_macro('\\newcommand{\\foo}{bar}')
and then a %latex cell with foo in it will be processed correctly, as will %jsmath and %html cells. Also,
sage: latex.add_to_preamble('\\usepackage{blah}')
will do what it says; it should only have an effect on %latex cells.
(In this patch, "macros" are things which are processed by latex and jsmath, while the "preamble" is only passed to latex. For both categories, you can add to the current string with latex.add_macro or latex.add_preamble, or you can replace it with latex.extra_macros or latex.extra_preamble.)
Some pictures are here and here.
Anyway, please test it out; the patch is against 3.4.2.alpha0.
Attachment: latex-5791.patch.gz
Passes tests on misc/latex.py and misc/latex_macros.py in 3.4.2.alpha0, and works as advertised at command-line and in notebook.
PDF version of documentation builds fine also. Another great addition to Sage-LaTeX integration.
So this is ready to go - positive review.
Merged in Sage 3.4.2.rc0.
Cheers,
Michael
See http://groups.google.com/group/sage-devel/browse_thread/thread/39f1d0e71eae2453 for the discussion: It would be great of one could add packages that are automatically included when running LaTeX, i.e. for commutative diagrams.
Cheers,
Michael
Component: misc
Issue created by migration from https://trac.sagemath.org/ticket/5791