数式の番号を囲む括弧を削除する

数式の番号を囲む括弧を削除する

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

MWE:

\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}

ここに画像の説明を入力してください

関連情報