In a way, I'm surprised that \cmidrule
works at all outside of tabular
-like and array
environments. The fact the use of \cmidrule
doesn't throw an immediate error message is not an indication that what you're doing can or should be expected to produce the result you're hoping to get.
If you must use \cmidrule
, do typeset the equations in question in an array
environment.

\documentclass{article}
\usepackage{array,amsmath,booktabs}
\newcolumntype{L}{>{\displaystyle}l}
\newcolumntype{R}{>{\displaystyle}r}
\begin{document}
\begin{minipage}[t]{0.22\textwidth}
\texttt{array} approach
\[
\renewcommand{\arraystretch}{1.28} % emulate display-style math setting
\begin{array}{@{} R @{{}={}} L @{}}
1 + 1 & 2 \\
1 + 1 & 2 \\
\cmidrule{1-2}
2 + 2 & 4 \\
2 + 2 & 4
\end{array}
\]
\end{minipage}\quad
\begin{minipage}[t]{0.22\textwidth}
\texttt{align*} approach
\begin{align*}
1 + 1 &= 2 \\
1 + 1 &= 2 \\
\cmidrule{1-2}
2 + 2 &= 4 \\
2 + 2 &= 4 \\
\end{align*}
\end{minipage}
\end{document}
align
here? – Werner Feb 26 at 3:08array
however\tag{eq1}
doesn't seem to work with that. What else do you recommend? – clay Feb 26 at 5:20\tag
s. You can also capture the horizontal coordinate of the widest elements within youralign
and then draw a rule to match the horizontal width of the construction. – Werner Feb 26 at 19:39