3

The following code

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}

\begin{align*}
0           &< t_n - a    &< \delta\\
- \delta    &< a- t_m     &< 0    
\end{align*}

\end{document}

produces this:

Could anyone please help me understand why there is such a large horizontal space, and how to fix it?

Thanks.

2
  • because the second ampersand divide columns in align environment. Do you like to align your math expression at two points? In this case you should look for array or for alignat environments.
    – Zarko
    Commented Nov 18, 2019 at 5:25
  • See also tex.stackexchange.com/q/159723 Commented Nov 18, 2019 at 7:16

1 Answer 1

4

It is not clear, what you like to achieve. I guess that you like to align your math expressions at two points. This you can do with use of the array or with alignat environments:

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat*}{3}
0       & < t_n - a & < \delta\\
-\delta & < a - t_m & < 0
\end{alignat*}

\end{document}

enter image description here

Or you like to align them only at one point? For example as follows:

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
0       & < t_n - a  < \delta\\
-\delta & < a - t_m  < 0
\end{align*}

\end{document}

enter image description here

Note: in align you can have more than one ampersand. However in such cases even ampersands separate columns of math expressions, which are aligned at odd ampersands.

4
  • Thanks! Indeed, my intention was to align the math expressions at the two points. So the align environment is used when you have just one aligning point, and the alignat environment is for when you have multiple aligning points?
    – Ovi
    Commented Nov 18, 2019 at 5:36
  • @Ovi, your conclusion is correct. With {...} after \begin{alignat} you inform environment how many columns you like to have. In your particular case, where the middle part of expressions almost have the same length, the difference between (correct) use of align and alignat is negligible.
    – Zarko
    Commented Nov 18, 2019 at 5:46
  • Thank you for the informative answer and comment!
    – Ovi
    Commented Nov 18, 2019 at 6:00
  • @Ovi, you are welcome!
    – Zarko
    Commented Nov 18, 2019 at 6:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .