4

I would like to itemize some equations but they don't appear on the same line as the bullets.

Here is a code example

\documentclass[11pt,a4paper]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

\begin{description}
    \item[i) ] foo foo foo foo
        \begin{equation}
            a^2 + b^2 = c^2
        \end{equation}
    \item[ii)] 
        \begin{equation}
            x^2 + y^2 = z^2 
        \end{equation}
\end{description}

\end{document}

Is it possible to write the second equation next to the description so that it looks like this:

ii) x^2 + y^2 = z^2                              (numberOfEq2)

1
  • why use description rather than enumerate? Dec 4, 2015 at 14:53

3 Answers 3

1

Based on this answer by Heiko Oberdiek, you can use an \inlineequation:

\documentclass[11pt,a4paper]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\makeatletter
\newcommand*{\inlineequation}[2][]{%
  \begingroup
    % Put \refstepcounter at the beginning, because
    % package `hyperref' sets the anchor here.
    \refstepcounter{equation}%
    \ifx\\#1\\%
    \else
      \label{#1}%
    \fi
    % prevent line breaks inside equation
    \relpenalty=10000 %
    \binoppenalty=10000 %
    \ensuremath{%
      % \displaystyle % larger fractions, ...
      #2%
    }%
    \hfill\@eqnnum
  \endgroup
}
\makeatother

\usepackage{hyperref}

\begin{document}

\begin{description}
    \item[i) ] foo foo foo foo \inlineequation{a^2 + b^2 = c^2}
    \item[ii)] \inlineequation{x^2 + y^2 = z^2}
\end{description}

\end{document}
7
  • Thanks for your answer but the solution to my answer would be a "combination" of yours and the answer of Bernard:
    – Rorschach
    Dec 4, 2015 at 12:34
  • What exactly would you like to combine? More space between the equation and its number? Dec 4, 2015 at 12:38
  • Thank you, but I want a combination of your answer and the one of Bernard: the equation should start next to the description "ii)" but at the same time the number of equations should be one above the other - how to do that?
    – Rorschach
    Dec 4, 2015 at 12:41
  • I adapted my solution to align the equation numbers to the right. Dec 4, 2015 at 12:49
  • 1
    This will not work for multiline equations. See my comment to Bernard's answer for a link to a more general solution. Dec 4, 2015 at 14:53
3

Here is a way:

\documentclass[11pt,a4paper]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

\begin{description}
    \item[i) ] foo foo foo foo
        \begin{equation}
            a^2 + b^2 = c^2
        \end{equation}
    \item[ii)]\leavevmode\vspace*{-\baselineskip}
        \begin{equation}x^2 + y^2 = z^2 \end{equation}
\end{description}

\end{document} 

enter image description here

1
  • 1
    \leavevmode\vspace*{-\baselineskip} will not work properly if the equation is high: a \frac, for instance, will shift the equation downwards. The solution proposed by Philippe Goutet in vertical-alignment-of-align-in-enumerate seems to always provide the right alignment between the \item and the equation (with maybe a \vspace{-\baselineskip} before the \item to avoid an excessive space above). Contrary to the solution with \inlineequation by cryingshadow, it also works with multiline equations. Dec 4, 2015 at 14:50
0

May be this is what you want,

\documentclass[11pt,a4paper]{scrbook}
\usepackage{amsmath}

\begin{document}

May be this is what you want,

\begin{eqnarray}
 && \text{i)  Foo foo foo,} \hspace{2mm}    a^2 + b^2 = c^2    \\
 && \text{ii) Foo foo foo,} \hspace{2mm}    x^2 + y^2 = z^2        
\end{eqnarray}


\end{document}

Here is my output,

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .