11

Is there a way to use a multline inside an \item element of enumerate WITHOUT a new line between the index of list and the formula?

 \begin{enumerate}[i.]
    \item $checkorder( (\lambda,\lambda,\lambda) ) \triangleq true$
    \item \begin{multline*}$$
     checkorder( (a,(u,U_1,U_2),(v,V_1,V_2)) ) \triangleq \\
     (u = \lambda \vee u \leq_A a) \wedge
     (v = \lambda \vee a \leq_A v) \wedge \\
     checkorder(U_1) \, \wedge checkorder(U_2) \wedge
     checkorder(V_1) \wedge checkorder(V_2)$$
     \end{multline*}
    \item $checkorder(T) \triangleq false$ negli altri casi
 \end{enumerate}

this is what i have: https://i.stack.imgur.com/udBX4.png

and this is what i would want: https://i.stack.imgur.com/2kv8M.png

David Carlisle
  • 757,742
Alberto
  • 1,887

2 Answers2

11

The amsmath alignment environments are only for display math. But mathtools augments the available environments:

\documentclass[a4paper]{article}
\usepackage{mathtools,enumerate,amssymb}
\begin{document}

\begin{enumerate}[i.]
    \item $\mathit{checkorder}( (\lambda,\lambda,\lambda) ) \triangleq \mathit{true}$
    \item $\begin{multlined}[t]
     \mathit{checkorder}( (a,(u,U_1,U_2),(v,V_1,V_2)) ) \triangleq \\
     (u = \lambda \vee u \leq_A a) \wedge
     (v = \lambda \vee a \leq_A v) \wedge {} \\
     \mathit{checkorder}(U_1) \wedge \mathit{checkorder}(U_2) \wedge
     \mathit{checkorder}(V_1) \wedge checkorder(V_2)
     \end{multlined}$
    \item $\mathit{checkorder}(T) \triangleq \mathit{false}$ negli altri casi
\end{enumerate}
\end{document}

enter image description here

Notice a couple of refinements: long function names should be inside \mathit, to get a better looking font in this case; the \wedge before \\ should be followed by {} to get correct spacing.

Never use $$ in LaTeX.

David Carlisle
  • 757,742
egreg
  • 1,121,712
3

I had a similar issue with \multline environment. So I came up with a forced solution. Here is what I did:

\item \abovedisplayskip-15pt 
      \belowdisplayskip\abovedisplayskip
      \begin{setlength}{\multlinegap}{0pt}
         \begin{multline*}
           2(x^2y-2xy^3+6xy)-3(-5xy+3x^2y\\-7xy^3)
            +5(xy^3-xy+x^2y)
      \end{multline*}
      \end{setlength}

Of course, egreg's solution is by far the best and mine is was just out of desperation in finding an immediate solutions. I know that my code above is not the best but hey it solved my problem. I have decided to implement egreg's answer into my code as it seems to better and more concise.

azetina
  • 28,884