答案1
align*
以下是使用 和的尝试tabularx
:
代码:
\documentclass{article}
\usepackage{mathtools}
\usepackage{tabularx}
\usepackage{showframe}
\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}
\begin{document}
\noindent
With \verb|align*|
\begin{align*}
&\text{Hi} & 1+1 &=2 &\text{I} \\
&\text{can have} & 1+1+1 &=2 &\text{whatever text} \\
&\text{I like} & 1 &=1 &\text{flushed left} \\
&\text{and right} & 1 &=1 &\text{with tabularx, equation at center} \\
\end{align*}
%
With \verb|tabularx*| (left and right columns of same size)
\medskip\par\noindent
\begin{tabularx}{\linewidth}{@{}X r@{}l Y@{}}
Hi & $1+1 $ & ${}=2$ & I \\
can have & $1+1 +1 $ & ${}=2$ & whatever text \\
I like & $1 $ & ${}=1$ & flushed left \\
and right & $1 $ & ${}=1$ & with tabularx, equation at center \\
\end{tabularx}
\end{document}