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: http://i.stack.imgur.com/udBX4.png

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

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.

  • thanks! why never use $$ ? – Alberto Feb 12 '12 at 11:52
  • 2
    See Why is \[...\] preferable to $$?. On this site appreciation for an answer is expressed by clicking on the upper arrow besides the text; usually, after a delay to see if other more useful answers come along, one accepts the better one. – egreg Feb 12 '12 at 12:08
  • +1 By the same rational, is it not more preferable to use \(...\) instead of $...$ I reference Joseph Wright's comments in Are ( and ) preferable to $? – cmhughes Feb 12 '12 at 17:14
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.

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.