1

Is it possible to number equations written in math mode? I tried "\begin{equation}" around math mode, but it gives errors.

\documentclass{article}
\usepackage[french,USenglish]{babel}
\usepackage[mmddyyyy]{datetime}
\usepackage{amsmath,amssymb}
\begin{document}

    I can number the equations using ``begin{equation}''.
    \begin{equation}
        A = \frac{\pi r^2}{2} 
    \end{equation}

    But, how to number the equations in written using math mode?
    \[\mathrm{ \frac {P \models Q\stackrel{Y} {\rightleftharpoons} P \mbox{, } P \lhd \langle X \rangle _Y} {P \models Q \rhd X} } \]

    \[\mathrm{ \frac {P \models Q, P \lhd \langle X \rangle _Y} {Q \rhd X} } \]
    
\end{document}

enter image description here

2
  • 1
    It's common to refer to displayed math material as “equation” even if it isn't a proper equation with an = sign.
    – egreg
    Aug 5 '21 at 7:57
  • Note that \[...\] IS math mode, just unnumbered math mode. Aug 5 '21 at 8:53
1

I think (but I may be wrong) the gather environment may be what you're looking for. Note that display-style math is in effect inside a gather environment.

enter image description here

\documentclass{article}
\usepackage[french,USenglish]{babel}
\usepackage[mmddyyyy]{datetime}
\usepackage{amsmath,amssymb}
\begin{document}

I can number a single-line equation using an \texttt{equation} environment.
\begin{equation}
   A = \frac{\pi r^2}{2} 
\end{equation}

I can number multi-line mathmode material with a \texttt{gather} environment.
\begin{gather}
    \mathrm{ \frac {P \models Q\stackrel{Y} \rightleftharpoons P ,\ 
       P \mathrel\lhd \langle X \rangle _Y} {P \models Q 
       \mathrel\rhd X} } \\[1ex] % "1ex" inserts a bit more vertical whitespace
    \mathrm{ \frac {P \models Q,\ 
       P \mathrel\lhd \langle X \rangle _Y} {Q \mathrel\rhd X} } 
\end{gather}
\end{document}
2
  • 4
    Congratulations for your 400K! It's not common knowledge, but the symbols \lhd and \rhd are binary operations (that is, \mathbin) rather than relations. Why? I really don't know, but it has been so since Lamport provided some additional symbols. In the case at hand, they seem to be used as relations, so something like \mathrel\lhd is needed (and a definition, of course, would be better).
    – egreg
    Aug 5 '21 at 7:56
  • @egreg - Many thanks for the congrats! And many thanks for the suggestion to give \lhd and \rhd status math-rel`, which I've implemented gladly.
    – Mico
    Aug 5 '21 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.