Align two inequalities -- newer version

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}

• Nothing changes in last ten years. The second example in @Werner answer in given link is still (only) way to solve your problem. Commented Apr 19, 2020 at 23:45

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}


• 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. Commented Apr 19, 2020 at 23:51
• You mean a_k would no more be centred in the middle column? Commented Apr 19, 2020 at 23:56
• Yes, so that it looks like just the limit are added. Why did you add {} and \le{} ? Commented Apr 19, 2020 at 23:58
• \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. Commented Apr 20, 2020 at 0:03
• 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. Commented Apr 20, 2020 at 0:15