ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 18 Apr 2013 03:45:07 +0200MathJax Font Sizes and Spacing/Positioning in Notebookhttps://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/I'd like to control the Latex fontsize in the notebook. In the first cell, I placed:
%html
<style>.MathJax {font-size: 200%;}</style>
... and in later cells' **view()** outputs the individual characters/symbols increase in size but the positioning/spacing gets all spread out and ugly.
What's the right/easy way to increase the latex fontsize in Sage's notebook and still have it look good?
Thu, 11 Apr 2013 01:41:01 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/Answer by ppurka for <p>I'd like to control the Latex fontsize in the notebook. In the first cell, I placed:</p>
<pre><code>%html
<style>.MathJax {font-size: 200%;}</style>
</code></pre>
<p>... and in later cells' <strong>view()</strong> outputs the individual characters/symbols increase in size but the positioning/spacing gets all spread out and ugly.</p>
<p>What's the right/easy way to increase the latex fontsize in Sage's notebook and still have it look good?</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?answer=14770#post-id-14770Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.Thu, 11 Apr 2013 04:00:44 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?answer=14770#post-id-14770Comment by rickhg12hs for <p>Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17916#post-id-17916Thanks, I hadn't tried right-click. Is there an easy way to control this programmatically on a per-cell basis? The right-click options seems to affect the entire worksheet.Thu, 11 Apr 2013 18:09:12 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17916#post-id-17916Comment by ppurka for <p>Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17886#post-id-17886I am not sure what you mean by that. It already has pretty good fontsize control. You can increase the fontsize of all the math, or you can *temporarily* increase the fontsize of any particular math by using a zoom trigger. The amount of scaling in both cases are configurable.Tue, 16 Apr 2013 00:01:06 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17886#post-id-17886Comment by rickhg12hs for <p>Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17891#post-id-17891Thanks. That may be enough for now. Would MathJax need some visibility into the javascript to get more/better fontsize control?Mon, 15 Apr 2013 16:12:26 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17891#post-id-17891Comment by ppurka for <p>Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17917#post-id-17917Well, it is in the MathJax docs :) I had once implemented a way for this menu to popup on double click, just like in jsmath the latex would popup on double click. Not sure if there is any interest in that behavior anymore.Thu, 11 Apr 2013 12:59:55 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17917#post-id-17917Comment by kcrisman for <p>Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17918#post-id-17918Is this in the notebook documentation? It seems like this would be useful on the "Help" page, not (just) in the reference manual, though it could be good there too...Thu, 11 Apr 2013 11:40:07 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17918#post-id-17918Comment by rickhg12hs for <p>Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17871#post-id-17871E.g., using Sage worksheet to demonstrate signal processing with symbolic math, it would be convenient to color and size items on the page depending upon signal path and/or signal processing node. Fontsize and color could be convenient visual cues. To control font color and size on a per-cell basis, would that require javascript control/changes within MathJax?Wed, 17 Apr 2013 21:27:08 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17871#post-id-17871Comment by ppurka for <p>Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17865#post-id-17865In that case you would be better off using the `html` command. I must admit using this is not optimal, but it is the fastest way to get custom color and font sizes.
Configuring MathJax would lead to changes in the math rendering throughout the worksheet. MathJax is responsible for converting Latex code, like `$x^2$`, to nicely rendered math. The math is placed within some special `span` or `div` tags.
We don't really customize MathJax that much (there is more or less one single file containing the customizations), we simply bundle it along with the notebook so that it can do its magic.Thu, 18 Apr 2013 03:45:07 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17865#post-id-17865Comment by ppurka for <p>Right click on any rendered Latex expression and you will get a MathJax menu. In that menu, you will get the option to scale all math, or zoom with some trigger, etc.</p>
https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17913#post-id-17913Does something like this help?
html("<font size=12px>this is $%s$</font>"%(LatexExpr(x^2 + 2)))
It is quite fragile though. And the `<font>` tag is also deprecated for years, and is not available in HTML5.Thu, 11 Apr 2013 23:45:46 +0200https://ask.sagemath.org/question/10009/mathjax-font-sizes-and-spacingpositioning-in-notebook/?comment=17913#post-id-17913