# Prevent line break before equation environment in enumerated list item

I try to accomplish the same thing as in this question: Prevent line break before equation environment in enumerated list item (to have the equation in the same line as "some text"), except that i dont want to use IEEEtran document class and i do want to have the equation number at the end of the line (the right).

\documentclass{report}
\usepackage{mathtools}
\begin{document}
\begin{itemize}
\item some text:
$$x = y = z$$
\end{itemize}
\end{document}


EDIT:

Both Andrew's and Bernard's answer works fine in the example, but if you are using the parameter fleqn in \usepackage[fleqn]{mathtools} you will get this:

• What's the purpose of / in the equation? And you mean \mathbb{R}, most likely
– user31729
Apr 17 '16 at 19:52
• it was just a random example yes \mathbb{R} instead of R
– Cfun
Apr 17 '16 at 19:54
• Do you require your equation be numbered (and possibly labeled for future \ref?) If not, just use $ delimiters and \displaystyle, if needed. Apr 17 '16 at 20:07 • yes it important it is numbered otherwise i would used $...\$ instead of equation environment.
– Cfun
Apr 17 '16 at 20:44
• Your MWE does not compile. More importantly, where do you want the equation number to appear? It is going to look unusual if it appears to the left of the "some text".
– user30471
Apr 17 '16 at 21:44

Here is a quick hack for moving the equation "up" so that it is on the same line as the "some text". This is done with a new environment itemequation that adjusts for the newline. If the text is too long, however, the equation will write over the top of the text. On the other hand, it not clear from the question what should happen in such cases.

Here is the output from the code:

and here is the code:

\documentclass{report}
\usepackage{mathtools}
\newenvironment{itemequation}{\vspace*{-\baselineskip}\equation}{\endequation}
\begin{document}
\begin{itemize}
\item some text:
\begin{itemequation}
x = y = z
\end{itemequation}
\end{itemize}
\end{document}


I define a new environment, inlineEq, which puts the equation on the same line as the current text, centred w.r.t. remaining white space on the line. It can be referenced.

\documentclass{report}
\usepackage{mathtools, amsfonts}
\usepackage{lipsum}
\newenvironment{inlineEq}[1]{%
#1\vspace*{-1\baselineskip}\equation\phantom{\mbox{#1}}}%
{\endequation}

\begin{document}

\begin{itemize}
\item% some text
\begin{inlineEq}{some text}
x = y \enspace ∀ x ∈ \mathbb{R}\label{EQ}
\end{inlineEq}
\lipsum[3]
We see in \eqref{EQ}
\end{itemize}

\end{document}