Alignment

431 views
Skip to first unread message

Nolan

unread,
Jan 24, 2011, 5:18:20 PM1/24/11
to MathJax Users
Hello MathJax Folks,

Great piece of work you guys have going here. I have one question
though, how do I get my LaTeX stuff to align to the left, as it seems
to default to the center? It appears to be based on the CSS text-align
tag, but nothing in the Configuration functions changes that value!
Also, \begin{flushleft} comes up with an error. Any help?

Thanks!

Nolan

Davide P. Cervone

unread,
Jan 24, 2011, 5:47:11 PM1/24/11
to mathja...@googlegroups.com
The alignment of displayed equations is controlled through the
displayAlign and displayIndent settings in the MathJax configuration.
See the comments in the MathJax/config/MathJax.js file or

http://www.mathjax.org/resources/docs/?//options/hub.html

for details.

As for flushleft, this is a text-mode environment, and MathJax doesn't
implement them (only the mathematics environments), so that can't be
used to control the placement of the equations. The displayAlign and
displayIndent settings are global to the page, so you can't have
regions with different settings. It may be possible to use CSS to
override it selectively, but I haven't tried that out, and it would
need to be carefully handled.

Davide

Nolan

unread,
Jan 24, 2011, 10:49:17 PM1/24/11
to MathJax Users
Hey Davide,

Those don't seem to update anything on the page for me. Left/Center/
Right, it always stays in the center. Could it be a problem with the
beta version (I used that one).

Nolan

Davide P. Cervone

unread,
Jan 25, 2011, 9:31:59 AM1/25/11
to mathja...@googlegroups.com
Are you using the NativeMML output jax, or the HTML-CSS output? There
was a bug (only recently fixed) with displayAlign and the NativeMML
jax. Have you set any CSS that could be affecting MathJax? (Either
explicitly using the MathJax classes, or implicitly by overriding
default settings for things like DIV and SPAN.)

Can you post your configuration settings? Or a URL to a test page
that exhibits the problem? (You can send by email if you prefer not
to make it public.)

Davide

Davide P. Cervone

unread,
Jan 25, 2011, 9:43:01 AM1/25/11
to mathja...@googlegroups.com
Also, make sure you use lower-case "left", "center", or "right".

Davide


On Jan 24, 2011, at 10:49 PM, Nolan wrote:

Nolan

unread,
Jan 25, 2011, 10:40:44 AM1/25/11
to MathJax Users
Thanks for the help Davide!
Here is my javascript file: http://nolanhergert.com/mathjax1.1/config/MathJax.js
And here's the page it's not working on: http://wiki.nolanhergert.com/doku.php?id=robotics:hw3martian

I don't know how to set it to NativeMML or HTML-CSS, so I'm guessing
I'm using the default. Changing the text-align tag
for .MathJax_Display (using Firebug) seems to make it do what I want
to. I also tried adding a CSS modification for .MathJax_Display to the
styles section of MathJax.js, but that didn't seem to have any effect
either.

Nolan

Davide P. Cervone

unread,
Jan 25, 2011, 11:18:37 AM1/25/11
to mathja...@googlegroups.com
OK, the problem is that you are not actually using the config/
MathJax.js file, since you are providing in-line configuration in your
install_js.php script. This loads an extension and sets the jax, but
doesn't set the displayAlign and displayIndent values.

Note that config/MathJax.js is only loaded when there is no in-line
configuration. If you want to load it as well, use

MathJax.Hub.Config({
config: ["MathJax.js"],
... (the rest of your configuration here) ...
});

I see that you are loading the jsMath2jax extension, but that is not
needed in your case because your page includes the <script> tags
already (not <span class="math"> or <div class="math"> for jsMath).
So your configuration could look like

<script src="http://www.nolanhergert.com/mathjax1.1//MathJax.js">
MathJax.Hub.Config({
jax: ["input/TeX","output/HTML-CSS"],
displayAlign: "left",
displayIndent: "2em"
});
</script>

or you could just use

<script src="http://www.nolanhergert.com/mathjax1.1//MathJax.js"></
script>

and let the config/MathJax.js file dothe configuration.

I'm not sure if the need for install_js.php, since you can just
include the <script> tag directly.

Anyway, the issue is that the configuration parameters are not
actually being set.

Davide

Nolan

unread,
Jan 25, 2011, 12:40:18 PM1/25/11
to MathJax Users
Ahhh, thank you! You were right on the spot (my jsmath DokuWiki plugin
was to blame). Works great now!

Nolan
Reply all
Reply to author
Forward
0 new messages