## LaTeX forum ⇒ Math & Science ⇒ Horizontal Spacing in aligned Equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Pratt_G
Posts: 3
Joined: Mon Sep 02, 2013 5:41 pm

### Horizontal Spacing in aligned Equations

Hi,

1. Why do I get non-uniform and inordinate spacing between the columns? The first summation is very close to "min" and the second summation is way too from the first summation.
2. Is there any way to left-align the columns? I want the third columns to be aligned left.

\documentclass[11 pt]{article}\usepackage {amsmath} \begin{document}   \begin{subequations}     \begin{align}       \min\limits_{\lambda} & \sum\limits_{k \in R} & (\sum\limits_{i=1}^{M} a_i \quad +\\       & & \sum \limits_{j=1}^N b_j \quad + \quad \sum       \limits_{j=1}^N c_j \quad +  \\     \end{align}					    \end{subequations}\end{document}

Thanks,
P
Last edited by localghost on Mon Sep 02, 2013 6:12 pm, edited 1 time in total.
Reason: Source code has to be tagged as such to keep a post clear and legible (see Board Rules).

Tags:

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
The alignat environment is your friend.
\documentclass[11pt]{article}\usepackage{mathtools}  % loads »amsmath« \begin{document}   \begin{subequations}     \begin{alignat}{2}       \min\limits_{\lambda} & \sum\limits_{k\in R} & \Big(\sum\limits_{i=1}^{M} a_i \quad + \\      & \sum \limits_{j=1}^N b_j \quad + \quad &\sum\limits_{j=1}^N c_j \quad +     \end{alignat}                                         \end{subequations}\end{document}

Since there seem to be going more elements into the equations, you might need to choose another number as parameter for the environment.

Best regards and welcome to the board
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Pratt_G
Posts: 3
Joined: Mon Sep 02, 2013 5:41 pm
Thanks. That worked. But in my general experience align and alignat have been very painful to use especially because their preset horizontal alignments. I prefer to use array instead, as it allows me to flexibly choose the alignment of individual columns. Now only if there was a way to use array under subequations environment.