0

I know the question has already been asked here but the last answer is from more than 9 years ago. Is there a simple way to align two (in)equalities and center the middle "column" ? I thought of using array but the font is smaller, it doesn't number the equations and so on.

Here is my code with align

\begin{align}
0 &< a_k &\leq \frac{1}{k}\\
\lim_{k \to \infty} 0 &< \lim_{k \to \infty} a_k &\leq \lim_{k \to \infty} \frac{1}{k}
\end{align}
Sileo
  • 307
  • Nothing changes in last ten years. The second example in @Werner answer in given link is still (only) way to solve your problem. – Zarko Apr 19 '20 at 23:45

1 Answers1

2

It is easy with alignat and eqparbox, which defines tagged boxes – all boxes sharing the same tag has as width the widest natural width of them.

   \documentclass{article}
\usepackage{mathtools}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}

\begin{document}

\begin{alignat}{2}
0 &< & \eqmathbox{a_k} & \leq \frac{1}{k}\\
\lim_{k \to \infty} 0 &< {}&\eqmathbox{ \smashoperator{\lim_{k \to \infty}} a_k} &\leq \lim_{k \to \infty} \frac{1}{k}
\end{alignat}


\begin{alignat}{3}
0 &<{} & & a_k \leq{} & &\frac{1}{k}\\
\lim_{k \to \infty} 0 &< {}& \smashoperator{\lim_{k \to \infty}}{} & a_k \leq{} & \lim_{k \to \infty}{} & \frac{1}{k}
\end{alignat}

\end{document} 

enter image description here

Bernard
  • 271,350
  • Thank you. By the way, how would I proceed if I wanted to align the the a_k and 1/k too ? It would be uncentered but I'm curious. – Sileo Apr 19 '20 at 23:51
  • You mean a_k would no more be centred in the middle column? – Bernard Apr 19 '20 at 23:56
  • Yes, so that it looks like just the limit are added. Why did you add {} and \le{} ? – Sileo Apr 19 '20 at 23:58
  • 1
    \smashoperator neutralises the width of the subscript under lim, when it is larger , so the it does not increase the spacing with the surrounding formulæ. For your new requirement, let me think a moment, but it will make more columns. – Bernard Apr 20 '20 at 00:03
  • 1
    Please see my edit: I've added another example for your second question. The {} added after \leqis because without it, ans the ampersand is just after this sign, there is no spacing after. – Bernard Apr 20 '20 at 00:15