I would like my MathJax displayed equations in IPython Notebook to be aligned at the left instead of centered. This is controlled by a core configuration option displayAlign in MathJax as described here.
I have tried to set this option in IPython Notebook by adding this to my config.js file
MathJax.Hub.Config({
displayAlign: "left"
});
but it doesn't have any effect.
How can I set MathJax core configuration options in IPython Notebook?
[Update] I have found one way that works: add the above configuration lines not to config.js but to mathjaxutils.js. In my case (Windows 8) this file is found here: C:\Anaconda\Lib\site-packages\IPython\html\static\notebook\js\mathjaxutils.js
. This is not a great solution though because it involves modifying a file that will presumably get overwritten the next time I update IPython.
[Update] The technique suggested by @Ian in the comments does work, but just one notebook at a time. To summarize, I created a file my_css.css whose content is
<script>
MathJax.Hub.Config({
displayAlign: 'left'
});
</script>
In the notebook, if I run this cell
from IPython.core.display import HTML
css_file = 'my_css.css'
HTML(open(css_file, "r").read())
displayed equations do get left aligned, as desired.
However, I would like this to be the default for all my notebooks. I tried adding this to my custom.js
MathJax.Hub.Config({
displayAlign: 'left'
});
and for good measure added this to my custom.css
<script>
MathJax.Hub.Config({
displayAlign: 'left'
});
</script>
But neither has any effect. If there is a way to make this setting a default for all notebooks without modifying the core IPython files, that would be perfect.