On Tue, Aug 17, 2010 at 01:38, David <dwarnol...@suddenlink.net> wrote: > Kevin, > > I got this to work! Only because I got such a complete set of > instructions. Thank you very much. :-)
Glad it worked David. > I'm on a Macbook. I created a folder /Users/darnold/bin and dropped > mathjax.py in there. Then in ~/.bash_profile I added: > > PYTHONPATH="/Users/darnold/bin" > export PYTHONPATH > > In my conf.py, I added: > > # Add any Sphinx extension module names here, as strings. They can be > extensions > # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. > extensions = ['mathjax'] > > mathjax_path = '/Users/darnold/Documents/mathjax/MathJax.js' > > I'll change this appropriately when I compile for our webserver, but > this works for development on my macbook at home. > > One weird thing: > > Here's a snap of part of the output on Safari: > > http://msemac.redwoods.edu/~darnold/images/safari.png > > Note the green color. Here's the same file on Firefox. > > http://msemac.redwoods.edu/~darnold/images/firefox.png > > Looks fine. No green. Spent a lot of time searching for the word > "green" in files only to come up empty. Very strange. > I had this too - it's related to CSS settings. Inspect your CSS. Install the Firebug add on in Firefox, or in Safari/Chrome you can add the Developer tools and then use "Web inspector". You will probably see the green elements belong to a CSS class called ".mo" or ".mi". You probably have another CSS class with the same name. In my case, the conflict came from some Sphinx/Pygments CSS settings that I had used to style source code printouts. Since the source code is always wrapped inside a "highlight" element, I just changed the Pygments CSS from ".mo" to ".highlight .mo" (and did this for about 20 other CSS elements). > Second, a question. Here's what the source wound up looking like in > the html file: > > <p>Since Pythagoras, we know that <span class="math">\(a^2+b^2=c^2\)</ > span>.</p> > <div class="math"> > \[(a+b)^2=a^2+2ab+b^2\]</div> > <div class="math">\[(a-b)^2=a^2-2ab+b^2\]</div> > > Isn't the following all that is needed by MathJax? > > <p>Since Pythagoras, we know that \(a^2+b^2=c^2\).</p> > > Why the span and the class? You are correct that the minimal settings will work, however, I left the span and div elements in there: others might have existing CSS styling settings, so these wrapping elements should allow their CSS to be easily customized. Would it be useful to have a mathjax.py setting to make this output optional? Kevin > David Arnold > College of the Redwoods > Eureka, CA 95501 -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.