1

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:
\begin{equation}
x = y = z
\end{equation}
\end{itemize}
\end{document}

enter image description here

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:

enter image description here

Cfun
  • 1,840
  • What's the purpose of / in the equation? And you mean \mathbb{R}, most likely –  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. – Steven B. Segletes 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". –  Apr 17 '16 at 21:44
  • @Andrew as usual at the right of course (end of the line) - some text [equation here] [hfill] [number] (i fixed the example sorry) – Cfun Apr 17 '16 at 22:11
  • If you want the equation numbers on the RHS then your MWE should have equation numbers on the right but it has them on the left. Can you please make your MWE compile and add in the formatting commands/options for equation numbers. –  Apr 17 '16 at 22:15
  • @Andrew not sure if my right is your left maybe a missunderstanding, i fixed the MWE it compile now, i see the equation number appears at the end of the line (i consider it the right for me). – Cfun Apr 17 '16 at 22:19
  • Hmm, not sure either as I agree with your definition of right, and I agree that your code puts it there. somehow I had the equation number on the left... Anyway, quick hack below. –  Apr 17 '16 at 22:38

2 Answers2

1

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:

enter image description here

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}
1

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} 

enter image description here

Bernard
  • 271,350