Skip to content

Multi line equations with center alignment of terms

pkra edited this page Jun 25, 2013 · 3 revisions

From https://groups.google.com/d/msg/mathjax-users/wIhEPFHaI9g/FRI3ikyaDZMJ


I have a problem with equation alignment. I'm trying to line up terms in an equation with each the terms in columns, but centered rather than left or right aligned. My problem and different attempts at solutions are given here:

http://jsfiddle.net/keithphw/9EH8X/6/

I'd be very grateful for any pointers.

Thanks and best regards, Keith


Hi Keith,

For the last method, you may first try to write the = and + sign in their own cell:

\begin{array}{c @{{}={}} c c @{{}+{}} c c} \cdot & & \uparrow & \uparrow & & \downarrow & \uparrow \ \beta_V & = & \frac{D}{V} & \beta_D & + & \frac{D}{E} & \beta_E \ \end{array}

Note that you can reduce the space by modifying the "columnspacing" value in the MathML source. This corresponds e.g. to the fifth parameter of Array: https://github.com/mathjax/MathJax/blob/master/unpacked/jax/input/TeX/jax.js#L1738

The definition of 'Array' and other similar environments can be found here: https://github.com/mathjax/MathJax/blob/master/unpacked/jax/input/TeX/jax.js#L987 https://github.com/mathjax/MathJax/blob/master/unpacked/extensions/TeX/AMSmath.js#L118

You might want to try another LaTeX environment with smaller column spacing or add your own definition to MathJax.Input.TeX.Definitions.environment. See http://docs.mathjax.org/en/latest/signals.html#creating-a-listener (I think there is a typo, it should be ""TeX Jax Ready " without space at the end)

Hope that helps, Fred.

Clone this wiki locally