1

I have increased separation between list items using \itemsep in itemized environment. How do I keep the item separation for inner list unaffected in minimum effort? One ad-hoc solution could be manually decreasing \itemsep value for the inner list. Is there an elegant way to achieve the same effect?

\documentclass{llncs}

\begin{document}

\begin{itemize} \itemsep2em

    \item \textbf{L11}: This is level 1 item

        \begin{itemize}
            \item \textbf{L21}: This is level 2 item
            \item \textbf{L22}: This is level 2 item
            \item \textbf{L23}: This is level 2 item
            \item \textbf{L24}: This is level 2 item
        \end{itemize}

    \item \textbf{L12}: This is level 1 item
    \item \textbf{L13}: This is level 1 item
    \item \textbf{L14}: This is level 1 item

\end{itemize}

\end{document}

enter image description here

2 Answers 2

1

You wouldn't see this effect with a standard class like article, as it defines the commands for the inner lists so that they reset \itemsep. But you can add a similar feature when using llncs:

\documentclass{llncs}

\usepackage{etoolbox}
\makeatletter
 \appto\@listii{\itemsep=0pt}
\makeatother
\begin{document}

\begin{itemize} \itemsep2em

    \item \textbf{L11}: This is level 1 item

        \begin{itemize}
            \item \textbf{L21}: This is level 2 item
            \item \textbf{L22}: This is level 2 item
            \item \textbf{L23}: This is level 2 item
            \item \textbf{L24}: This is level 2 item
        \end{itemize}

    \item \textbf{L12}: This is level 1 item
    \item \textbf{L13}: This is level 1 item
    \item \textbf{L14}: This is level 1 item

\end{itemize}

\end{document}

You can also use enumitem to setup a similar effect:

\usepackage{enumitem}
\setlist[1]{itemsep=2cm}
\setlist[2]{itemsep=0pt}
0

You can save the \itemsep as \myitemsep and then use it for inner list.

\documentclass{llncs}
\usepackage{enumitem}
\newlength{\myitemsep}
\setlength{\myitemsep}{\itemsep}
\begin{document}

\begin{itemize}[itemsep=2em]
    \item \textbf{L11}: This is level 1 item
        \begin{itemize}[itemsep=\myitemsep]
            \item \textbf{L21}: This is level 2 item
            \item \textbf{L22}: This is level 2 item
            \item \textbf{L23}: This is level 2 item
            \item \textbf{L24}: This is level 2 item
        \end{itemize}

    \item \textbf{L12}: This is level 1 item
    \item \textbf{L13}: This is level 1 item
    \item \textbf{L14}: This is level 1 item

\end{itemize}

\end{document}

enter image description here

You must log in to answer this question.

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