Math & Sciencesquare brackets around equation numbers?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
crispy
Posts: 2
Joined: Fri Jan 23, 2009 10:36 pm

square brackets around equation numbers?

Post by crispy »

Is this possible? I've done a fair bit of searching and can't seem to figure out how to do this. Parentheses are the default, but I need brackets for a journal submission. Can anyone help?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

square brackets around equation numbers?

Post by gmedina »

Hi,

you can achieve that using the mathtools package; take a look at the package documentation (Section 3.2 COntrolling tags, pp. 8ff)

Supplement:

Of course the same modification can be done without the mathtools package. The next sample codes show how to proceed depending on whether or not the amsmath package has been loaded:

First, without loading amsmath:

Code: Select all

Code, edit and compile here:
\documentclass{article}
%changing the tag appereance without loading amsmath
\makeatletter
\def\@eqnnum{{\normalfont \normalcolor [\theequation]}}
\makeatother
\begin{document}
\begin{equation}
a=b
\end{equation}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Now, when amsmath has been loaded:

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{amsmath}
%changing the tag appereance when amsmath has been loaded
\makeatletter
\def\tagform@#1{\maketag@@@{[#1]\@@italiccorr}}
\makeatother
\begin{document}
\begin{equation}
a=b
\end{equation}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1,1,2,3,5,8,13,21,34,55,89,144,233,...
crispy
Posts: 2
Joined: Fri Jan 23, 2009 10:36 pm

Re: square brackets around equation numbers?

Post by crispy »

Thanks, that worked great! I am using the "leqno" option for the article class, and the first code (not dependent on amsmath) put the equation number back on the right. The amsmath version kept it on the left, however. Mathtools looks useful as well...
Post Reply