Dear sage devel
I have two suggestions for jsmath in
1. The text \newcommand{\Bold}[1]{\mathbf{#1}} is inserted to each TeX
formula shown by "show" command. Why not to define this command in
preamble? Something like inserting into preamble
<script type="text/javascript"> jsMath.Macro('Bold','\\mathbf{#1}',1)
</script>
2. What about to insert \displaystyle into each TeX expression before
pasing it to the jsmath?
Are there any objections for not to do this? Is the correct way to
achieve the second task to change the code in latex.py (I added simply
two \displaystyle strings, the experimental patch is at
http://user.mendelu.cz/marik/temp/13536.patch )
Thanks
Robert
class JSMath:
......
def eval(self, x, globals=None, locals=None, mode='display'):
r"""
Render LaTeX input using JSMath. This returns
a :class:`JSMathExpr`.
.......
"""
# in JSMath:
# inline math: <span class="math">...</span>
# displaymath: <div class="math">...</div>
from sage.misc.latex_macros import
sage_configurable_latex_macros
if 'display' == mode:
return JSMathExpr('<html><div class="math">'
+ ''.join
(sage_configurable_latex_macros)
+ _Latex_prefs._option['macros']
+ '\displaystyle %s</div></html>'%x)
elif 'inline' == mode:
return JSMathExpr('<html><span class="math">'
+ ''.join
(sage_configurable_latex_macros)
+ _Latex_prefs._option['macros']
+ '\displaystyle %s</span></html>'%x)
else:
# what happened here?
raise ValueError, "mode must be either 'display' or
'inline'"
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org