0

Is it possible to write few equations, number them automatically, and also describe the equations with some text?

I am unble to write some text in the \begin{equation} part

This is my case

\documentclass{standalone}
\usepackage{amsmath}
\begin{document}
\begin{equation}
Description of the equation 1
                         eq1             (1)
Description of the equation 2
                         eq2             (2)
\end{equation}
\end{document}

Edit after applying the solutions below -

the additional problems are all equations should be aligned and all texts should be aligned and if possible numbering can be controlled / reset.

3 Answers3

1

You may want to put the descriptions outside the equation environments.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Description of the equation 1
\begin{equation}
                         E=m\,c^2
\end{equation}                       
Description of the equation 2
\begin{equation}
                         E=h\,\nu
\end{equation}
This equation has no counter
\begin{equation*}
                         F=E-T\,S
\end{equation*}
\setcounter{equation}{0}
Now we start at 1 again
\begin{equation}
                         F=m\,a
\end{equation}
But I cannot recommend to reset the equation number.
\end{document}

EDIT: Added more lines and output:

enter image description here

  • the numbering should be continous. wouldnt it mark 1 on both the equations? – infoclogged Jan 03 '18 at 17:34
  • @infoclogged No. Please just compile the code. –  Jan 03 '18 at 17:36
  • cool, compiled and works. But how do I reset the numbering. Not all the equation needs numbering. The following equations should start again with 1. Does it fit in the context of the asked question or should I ask a new one? – infoclogged Jan 03 '18 at 17:54
  • @infoclogged Please see the update. Note, however, I cannot recommend to reset the equation number. –  Jan 03 '18 at 17:57
  • vertical spacing is very peculiar -- equations should be evenly spaced and they're not. unfortunately, i'm not able to investigate. – barbara beeton Jan 03 '18 at 18:01
  • @barbarabeeton Well, this is what the above MWE gives me both with xelatex and pdflatex. I'm using the most recent TeXLive distribution on a Mac. It would be interesting to see what you got. –  Jan 03 '18 at 18:07
1

Hope, I understand your question

\documentclass[]{article}
\usepackage{amsmath}


\begin{document}

\begin{align}
    \text{Description of the equation 1} \nonumber\\
    E &= mc^2 \\
    \text{Description of the equation 2} \nonumber\\
    E &= h\nu
\end{align}

\end{document}

enter image description here

sergiokapone
  • 5,578
  • 1
  • 16
  • 39
1

Here are three ways for comparatively short descriptions (or comments, or …) inside equations, with the \intertext or \shortintertext (the latter from mathtools), or with \text in the blast column of a flalign environment:

\documentclass[]{article}
\usepackage[showframe]{geometry} 
\usepackage{mathtools}
\usepackage{lipsum} 

\begin{document}

\lipsum[3]
\begin{align}
  \intertext{Description of equation 1}
  E & = mc² \\
  \intertext{Description of equation 2}
  E & = h\nu
\end{align}

\begin{align}
  \shortintertext{Description of equation 3}
  E & = mc² \\
  \shortintertext{Description of equation 4}
  E & = h\nu
\end{align}

\begin{flalign}\setcounter{equation}{0}
  & & E &= mc² & & \text{\footnotesize Description of equation 1}\\
  & & E &= hν& & \text{\footnotesize Description of equation 2}
\end{flalign}

\end{document} 

enter image description here

Bernard
  • 271,350
  • perfect. is it possible to left align the \intertext so that the text aligns with the main body. Currently it is misalgined with the main body when I compile your code. Also, can you please update the answer with equation 5 and 6 to be reset to numbers 1 and 2 – infoclogged Jan 03 '18 at 18:21
  • @infoclogged: I've reset the equation counter (but normally, numbering is fully automatic). As to your misalignment with \(short)intertext, this most probably comes from something in your code: as you can see in the update, the text begins at the left margin. – Bernard Jan 03 '18 at 20:01