# Equation incl. number on the same line as theorem environment

I have this:

\begin{lemma}
$$L_b \circ L_a = L_{L_b(a)} \circ L_b.$$
\end{lemma}

and I would like the equation to be on the same line as the lemma, with a number label.
How can it be solved?

• Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
– user31729
May 29, 2014 at 14:07
• I would avoid such a layout: a statement consisting of an equation only is incomplete. Either add some words about the hypotheses, or just state the equation without calling it “Lemma”. You can refer to it by the equation number. May 29, 2014 at 14:29

You can manually set this very specific requirement:

\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{lemma}{Lemma}
\begin{document}
Some regular text.
\begin{lemma}
This is a lemma.
\end{lemma}
Here is a break of some more text.
\begin{lemma}
$$L_b \circ L_a = L_{L_b(a)} \circ L_b.$$
\end{lemma}
Another break of regular text.

\medskip
\refstepcounter{lemma}%
\noindent\leavevmode\rlap{\textbf{Lemma~\thelemma.}}\hfill%
$L_b \circ L_a = L_{L_b(a)} \circ L_b.$\hfill%
\refstepcounter{equation}%
\llap{(\theequation)}\par%
\medskip

Some final text.
\end{document}

\medskip seemed sufficient in terms of the spacing. However, if need be, one can dig through the code and find the exact vertical spacing above/below the lemma to make it identical to the rest.

The overlapping (\rlap and \llap) is to make sure the equation is eventually centred when using \hfill.

• Fine, it works. But how complicated has all this become... May 30, 2014 at 8:52
• @Gerard: I don't know what to say... you want something out of the ordinary... then expect something out of the ordinary.
– Werner
May 30, 2014 at 16:35

One can also define a centredequ environment that centres the equation in the remaining free part of the current line. It works with the cleveref package:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}

\usepackage{amsmath,amsthm}
\newtheorem{lemma}{Lemma}

\usepackage{cleveref}
\newcounter{centredequ}
\newenvironment{centredequ}{\refstepcounter{equation}\hfill\begin{math}}{\end{math}\hfill$(\theequation)$\par\noindent}
\crefname{centredequ}{eq.}{eqs. }
\Crefname{centredequ}{Eq.}{Eqs. }

\begin{document}

First a displayed equation:
$$\label{disp} a = b$$
Some regular text with a centred equation: \begin{centredequ}\label{taut}
a' = b'.
\end{centredequ}
\Cref{taut} is almost the same as \cref{disp}.

\begin{lemma}
This is a lemma.
\end{lemma}
Here is a break of some more text.

\begin{lemma}\label{lem2}
\begin{centredequ}L_b \circ L_a = L_{L_b(a)} \circ L_b.\label{com}\end{centredequ}%
\end{lemma}
As we can see from \cref{taut} and \cref{lem2}, \cref{com} …

\end{document}

• Technically the equation won't be centered using this method, as is displayed in equation (2). But that may be sufficient for the OP. It's noticeable when you have the same equation just above/below Lemma 2.
– Werner
May 29, 2014 at 18:32