如何設定方程式和方程式編號之間的 \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}

相關內容