5

I have an itemize environment in a description, unfortunately that doesn't look that nice. Here's an MWE:

\documentclass{article}
\begin{document}
\begin{description} 

  \item[Long description]
    \begin{itemize} 
      \item Foo
      \item Bar
    \end{itemize} 

  \item[Long description]
    \hfill \\
    \begin{itemize} 
      \item Foo
      \item Bar
    \end{itemize} 

\end{description}
\end{document}

This is how it looks like.

enter image description here

The first itemize environment doesn't look nice. So I tried to fix it in the second itemize environment, but I get an extra paragraph, which is not so nice either. I could add \vspace{-1cm} to get rid of it, but that looks a bit like a hack. So my question is, what is the proper way of doing this? And if the solution with \vspace{-1cm} is the way to go, what do I put inside the brackets? Is there a command that gives my the height of one line?

  • 1
    you can use the same mechanism recommended to start a list right after a theorem heading: \leavevmode. – barbara beeton May 6 '14 at 17:59
  • Perfect, that does exactly what I need. If you put that into an answer, I will accept it. – pfnuesel May 6 '14 at 18:01
5

you can use the same mechanism recommended to start a list right after a theorem heading: \leavevmode.

\documentclass{article}
\begin{document}
\begin{description} 

  \item[Long description]
    \leavevmode
    \begin{itemize} 
      \item Foo
      \item Bar
    \end{itemize} 

\end{description}
\end{document}

which produces

output of example code

  • 1
    One possible approach seems to be instead \item[Long description]\mbox{}: is this acceptable as well? – pluton May 6 '14 at 18:44
  • 2
    @pluton -- yes, the \mbox will also work. the necessary concept is that the description environment leaves you in horizontal mode, and anything that will get you out of that (without, in this case, producing any visible output) should work. – barbara beeton May 6 '14 at 18:51

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.