1

how can I write equation numbers in latex. like 1, 2, and so on.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\pdv{T^k}{t} = 
-\frac{\dot{f}_t^k}{A\varepsilon_{\textrm{cat}}C_t^k}
 \frac{T_i^k-T_i^{k-1}}{\Delta z}
+\frac{\pi D_i}{A\varepsilon_{\textrm{cat}}C_t^kC_p^k}
+\frac{\rho_{\textrm{cat}}a}{\varepsilon_{\textrm{cat}}C_t^kC_p^k}
\sum_{i=1}^{N} \eta_i^kr_i^k(-\Delta H_{\!f,i}^k)
\]
\end{document}
Bernard
  • 271,350
Vishnu
  • 93

3 Answers3

5

To switch from an unnumbered to a numbered displayed equation, all you have to do is replace \[ and \] with \begin{equation} and \end{equation}.

enter image description here

\documentclass{article}
\usepackage{amsmath,geometry}
\providecommand\pdv[2]{\frac{\partial #1}{\partial #2}}
\begin{document}
Unnumbered displayed equation:
\[
\pdv{T^k}{t} = 
-\frac{\dot{f}_t^k}{A\varepsilon_{\textrm{cat}}C_t^k}
 \frac{T_i^k-T_i^{k-1}}{\Delta z}
+\frac{\pi D_i}{A\varepsilon_{\textrm{cat}}C_t^kC_p^k}
+\frac{\rho_{\textrm{cat}}a}{\varepsilon_{\textrm{cat}}C_t^kC_p^k}
\sum_{i=1}^{N} \eta_i^kr_i^k(-\Delta H_{\!f,i}^k)
\]

\bigskip Numbered displayed equation: \begin{equation} \pdv{T^k}{t} = -\frac{\dot{f}t^k}{A\varepsilon{\textrm{cat}}C_t^k} \frac{T_i^k-T_i^{k-1}}{\Delta z} +\frac{\pi D_i}{A\varepsilon_{\textrm{cat}}C_t^kC_p^k} +\frac{\rho_{\textrm{cat}}a}{\varepsilon_{\textrm{cat}}C_t^kC_p^k} \sum_{i=1}^{N} \eta_i^kr_i^k(-\Delta H_{!f,i}^k) \end{equation} \end{document}

Mico
  • 506,678
2

In addition to the excellent suggestions above in comments section -- if you wish to do manual numbering add the \tag syntax at the end of the equation --\tag{..3.1.1a,b} \label{myeq} --the \label syntax for referencing can be plugged in if desired

Off course you can revert to auto numbering with the equation environment

And the negative points are not mine(-1)

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
{T^k}{t} = 
-\frac{\dot{f}_t^k}{A\varepsilon_{\textrm{cat}}C_t^k}
 \frac{T_i^k-T_i^{k-1}}{\Delta z}
+\frac{\pi D_i}{A\varepsilon_{\textrm{cat}}C_t^kC_p^k}
+\frac{\rho_{\textrm{cat}}a}{\varepsilon_{\textrm{cat}}C_t^kC_p^k}
\sum_{i=1}^{N} \eta_i^kr_i^k(-\Delta H_{\!f,i}^k) \tag{..3.1.1a,b} \label{myeq}
\]

For example, see \eqref{myeq}. \end{document}

js bibra
  • 21,280
  • 4
    I think it should be labelled quite strongly that for newcomers this is not a good idea. Let LaTeX handle the numbering. Otherwise we'll see users writing \tag{1} , \tag{2} .... – daleif Jun 25 '20 at 08:07
  • 1
    Observe that the OP asked about simple equation numbers such as 1 and 2, not ..3.1.1a,b. – Mico Jun 25 '20 at 10:08
  • I just had need non-default equation numbers so this answer worked well for me. – John1024 Oct 07 '20 at 21:47
0

Either you can continue to use \[ \] and use the \tag{} to label the equation as well as the '\label{}' to allow it to be referenced later, or you can use '\begin{equation}' & '\end{equation}' instead so that it will automatically label the equation for you.

If you choose to use \begin{equation} and you would like your equation to be numbered differently, you can still use \tag to label it differently.

For example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\pdv{T^k}{t} = 
-\frac{\dot{f}_t^k}{A\varepsilon_{\textrm{cat}}C_t^k}
 \frac{T_i^k-T_i^{k-1}}{\Delta z}
+\frac{\pi D_i}{A\varepsilon_{\textrm{cat}}C_t^kC_p^k}
+\frac{\rho_{\textrm{cat}}a}{\varepsilon_{\textrm{cat}}C_t^kC_p^k}
\sum_{i=1}^{N} \eta_i^kr_i^k(-\Delta H_{\!f,i}^k) \tag{1.1} \label{eq1}
\]
\end{document}

or,

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\pdv{T^k}{t} = 
-\frac{\dot{f}_t^k}{A\varepsilon_{\textrm{cat}}C_t^k}
 \frac{T_i^k-T_i^{k-1}}{\Delta z}
+\frac{\pi D_i}{A\varepsilon_{\textrm{cat}}C_t^kC_p^k}
+\frac{\rho_{\textrm{cat}}a}{\varepsilon_{\textrm{cat}}C_t^kC_p^k}
\sum_{i=1}^{N} \eta_i^kr_i^k(-\Delta H_{\!f,i}^k) \tag{1.1} \label{eq1}
\end{equation}
\end{document}