# Changing the formatting of equation numbers

How can I change equation numbering so that the chapter number is outside the parenthesis like this:

1(1)

(1.1)

You need to redefine \tagform@ from amsmath (to remove the outer parentheses) and \theequation (to add them in the desired location):

\documentclass{book}
\usepackage{amsmath}

\renewcommand\theequation{\thechapter(\arabic{equation})}
\makeatletter
\def\tagform@#1{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}}
\makeatother

\begin{document}

\chapter{Test Chapter}
\eqref{eq:test}
$$\label{eq:test} a=b.$$

\end{document}


• please note that this removes the code that causes the equation number (and parentheses) to remain upright in italic environments, as in theorems. – barbara beeton Jul 2 '13 at 21:59
• @barbarabeeton Hmmmm... I don't think my code removes this feature, or am I missing something? This example code shows the number and parantheses upright in a theorem-like structure: \documentclass{book} \usepackage{amsmath} \usepackage{amsthm} \renewcommand\theequation{\thechapter(\arabic{equation})} \makeatletter \def\tagform@#1{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}} \makeatother \newtheorem{theo}{Theorem} \begin{document} \chapter{Test Chapter} \ref{eq:test} \begin{theo} $$\label{eq:test} a=b.$$ \end{theo} \end{document} – Gonzalo Medina Jul 3 '13 at 0:48
• the example you give does work. however, it's not what i meant. what i meant was having the \ref{...} as part of the theorem text, say a reference in the theorem to a numbered equation that's outside the theorem statement. when that happens, the reference is italic, not upright. – barbara beeton Jul 3 '13 at 18:03
• @barbarabeeton ah, I see. This, however, is not due to my code; \ref behaves like that; on the other hand, \eqref (which should be used here instead of \ref, anyway) will still produce the reference in upright font. I updated my answer to change \ref for \eqref. – Gonzalo Medina Jul 4 '13 at 21:34
\renewcommand\theequation{\thechapter(\arabic{equation})}

• this has produced the following : (12(1)). How can I remove the outside parenthesis so as it looks like this: 12(1)? – user33119 Jul 2 '13 at 21:18
• If you are using amsmath see Gonzalo's answer. Questions should always have a complete small document that shows the problem. If you are not using amsmath the \def\@eqnnum{{\normalfont \normalcolor \theequation}} is the standard definition with () removed – David Carlisle Jul 2 '13 at 21:49