
我正在使用equation
帶有amsmath
包的環境。我想刪除方程式編號兩側的括號。
我希望將我的方程式標記為 1, 2, 3 ... 而不是 (1), (2), (3)。
有適當的命令嗎?
答案1
如果你正在使用amsmath
,只需\tagform@
這樣重新定義即可
\makeatletter
\renewcommand\tagform@[1]{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}}
\makeatother
微量元素
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\renewcommand\tagform@[1]{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}}
\makeatother
\begin{document}
\begin{equation}
x=y
\end{equation}
\end{document}
編輯
正如egreg 所注意到的,您可能希望\eqref
在列印引用時保留括號。在這種情況下,將上面的程式碼替換為
\makeatletter
\let\oldtagform@\tagform@
\renewcommand\tagform@[1]{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}}
\renewcommand{\eqref}[1]{\textup{\oldtagform@{\ref{#1}}}}
\makeatother
微量元素:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\let\oldtagform@\tagform@
\renewcommand\tagform@[1]{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}}
\renewcommand{\eqref}[1]{\textup{\oldtagform@{\ref{#1}}}}
\makeatother
\begin{document}
\begin{equation}\label{myeq}
x=y
\end{equation}
A reference to equation \eqref{myeq}
\end{document}
輸出:
答案2
放
\makeatletter
\def\@eqnnum{{\normalfont \normalcolor \theequation}}
\makeatother
在序言中
\documentclass{article}
\makeatletter
\def\@eqnnum{{\normalfont \normalcolor \theequation}}
\makeatother
\begin{document}
\begin{equation}
c^2 = a^2 + b^2
\end{equation}
\end{document}