# Customize equation numbering for Equation environment?

You can use `\tag`

:

```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{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} \tag{3.1}\label{eq:3.1}
\end{equation}
\end{document}
```

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}
\begin{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{equation}
\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}
\begin{equation}
1+1=3?
\end{equation}
\begin{equation}
1+1\neq3
\end{equation}
\section{Some section or chapter without content...}
\section{Content!}
\begin{equation}
1+1=2
\end{equation}
\begin{equation}
1+2=3
\end{equation}
\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.