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

  • 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 – SAM 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. – SAM 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". – Andrew Apr 17 '16 at 21:44
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

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.