如何设置方程和方程编号之间的 \quad 空间与居中

如何设置方程和方程编号之间的 \quad 空间与居中

如何设置\quad方程式和方程式编号之间的间距,并使输出居中,即方程式将居中,输出应如下所示

A + b (1)

A + b (2)

答案1

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath}
\begin{document}

The usual setting (in \LaTeX\ and generally) is to have the numbers flush to the edge
\begin{align}
    A &+ b \\
    Ax &+ zz
\end{align}

But if you really need this layout you can do the following
(replacing 1em by whatever space you need):

\newcommand\mytag{\hspace*{1em}\refstepcounter{equation}(\theequation)}
\[
\begin{aligned}
    A &+ b &\mytag\\
    Ax &+ zz &\mytag
\end{aligned}
\]

\end{document}

相关内容