# Equation numbering in square brackets [duplicate]

Does anyone knows how can I use square brackets instead of parenthesis when numbering my equations?

I used this command:

$$y = 2x$$


The number appears on the right hand side like (1) I want to make it [1].

Does anyone have any ideas?

• I want to make it [1]. In square bracket not in parenthesis Commented Apr 24, 2015 at 11:35
• How do you want to refer to those equations? With [1] too?
– user31729
Commented Apr 24, 2015 at 11:36
• See mathtools, one of its features is to control the formatting of the equation number. Commented Apr 24, 2015 at 11:37

This is much simpler if you load mathtools, an add-on package for amsmath:

\documentclass{article}

\usepackage{mathtools}

\newtagform{brackets}{[}{]}
\usetagform{brackets}

\begin{document}

$$\label{eq:test} y = 2x$$

See eq~\eqref{eq:test}.
\end{document}


Result:

• For some reason I can't download the mathtools. I check to package manager (Admin) but it's not there Commented Apr 24, 2015 at 13:07
• mathtools is part of texlive and i think of miktex too Commented Apr 24, 2015 at 13:08
• tex.stackexchange.com/a/187728/59716 Commented Apr 24, 2015 at 13:12

If package amsmath is loaded, then it uses \tagform@ for the formatting of the equation number:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\def\tagform@#1{\maketag@@@{[\ignorespaces#1\unskip\@@italiccorr]}}
\makeatother

\begin{document}
$$\label{eq:y=2x} y = 2x$$
Equation \eqref{eq:y=2x}.
\end{document}


Standard LaTeX uses \@eqnum for this purpose:

\makeatletter
\renewcommand*{\@eqnnum}{{\normalfont \normalcolor [\theequation]}}
\makeatother