# Customize equation numbering for Equation environment?

I want to manually label equation number ? For example I want to label this equation 3.1 instead of (1) which automatically pops up. Is it also possible in split environment as well or not ?

$$\log \mu_{ijk}= \lambda + \lambda_i ^I + \lambda_j ^J+\lambda_k ^K+\lambda_{ij} ^{IJ}+\lambda_{ik} ^{IK}+\lambda_{jk} ^{JK}+\lambda_{ijk} ^{IJK} \label{eq:3.1}$$

• try tag{\thesection.\theequation}; I think this has been asked before somewhere... – cmhughes Mar 10 '14 at 2:21

## 4 Answers

You can use \tag:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\log \mu_{ijk}= \lambda + \lambda_i ^I + \lambda_j ^J+\lambda_k ^K+\lambda_{ij} ^{IJ}+\lambda_{ik} ^{IK}+\lambda_{jk} ^{JK}+\lambda_{ijk} ^{IJK} \tag{3.1}\label{eq:3.1}$$
\end{document}


• Excellent !! How to do the exact same thing in equation and split environment together ? – user35571 Mar 10 '14 at 2:36

I guess you are looking for a way to number your equations "within" sections, that is, add the section number before the equation number.

This can be done automatically if you add the line

\numberwithin{equation}{section}


in your preamble, without any manual intervention.

MWE:

\documentclass{article}
\usepackage{amsmath}
\numberwithin{equation}{section}

\begin{document}

\section{Test}
Some text

\section{Another Test}
Some text

\section{An equation}
$$\log \mu_{ijk}= \lambda + \lambda_i ^I + \lambda_j ^J+\lambda_k ^K+\lambda_{ij} ^{IJ}+\lambda_{ik} ^{IK}+\lambda_{jk} ^{JK}+\lambda_{ijk} ^{IJK} \label{eq:3.1}$$

\end{document}


Output:

Personally, I wanted to have "Eq." in front of the equation numbering. I thought you had the same question but then with "equation" instead of "Eq.". Also, I wanted to have the section numbering in front of the equation, so that the equations are numbered as (Eq. 3.1) instead of (1).

I started from How to change equation numbering style.

\documentclass{article}
\usepackage{amsmath} % \numberwithin{equation} doesn't exist without this package.
\numberwithin{equation}{section} % This line resets equation numbering when starting a new section.
\renewcommand{\theequation}{Eq. \thesection.\arabic{equation}} % This line ads "Eq." in front of your equation numbering.
\begin{document}
\section{Introduction}
$$1+1=3?$$
$$1+1\neq3$$
\section{Some section or chapter without content...}
\section{Content!}
$$1+1=2$$
$$1+2=3$$
\end{document}


Unfortunately, the order of lines is crucial, because it is possible to override "\renewcommand{\theequation}{Eq. \thesection.\arabic{equation}}" with "\numberwithin{equation}{section}", and you only get (1.1).

Note that if "\numberwithin{equation}{section}" is left out, equation numbering continues after opening a new section, so it numbers like (Eq. 1.1), (Eq. 1.2), (Eq. 3.3), (Eq. 3.4), which is strange.

PS, I don't know why you would like to force a tag to become "equation 3.1", I thought the automatic numbering was a good thing.

• This doesn't answer the question. – Werner Feb 21 '17 at 21:43
• Sorry for my late response, my previous answer was too short and was lacking a picture. The complete script should print "Eq. 3.1", which answers the question, right? I don't know why you would like to force a tag to become "equation 3.1", I thought the automatic numbering was a good thing.... – Teun Zijp Feb 27 '17 at 1:02

THis worked for me Thank you

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\tag{3.1} \begin{split} \log \mu_{ijk}= \lambda + \lambda_i ^I + \lambda_j ^J+\lambda_k ^K+\lambda_{ij} ^{IJ}+\lambda_{ik} ^{IK}+\lambda_{jk} ^{JK}+\lambda_{ijk} ^{IJK} \tag{3.1}\label{eq:3.1} \end{split}$$
\end{document}

• I believe only giving tag while doing \begin equation was sufficient. – user1953366 Oct 28 '20 at 3:23