42

I have made a list of questions and subquestions using nested \itemize commands, like this:

\documentclass[11pt]{report}
\usepackage[british]{babel}
\usepackage{enumitem}

\begin{document}

\begin{itemize}
  \item{First item}
    \begin{itemize}
      \item{First subitem}
      \item{Second subitem}
      \item{Third subitem}
    \end{itemize}
  \item{Second item}
  \item{Third item}
\end{itemize}

\end{document}

Now this works fine for me, but I am just wondering, can you also create bullets when using \subitem instead of a nested list, like below? I do get an indentation at my subquestions, but no bullets.

\begin{itemize}
  \item{First item}
    \subitem{First subitem}
    \subitem{Second subitem}
    \subitem{Third subitem}
  \item{Second item}
  \item{Third item}
\end{itemize}
  • 16
    Don't use \subitem for this purpose. It's defined only for working in an index. – egreg Nov 25 '12 at 15:07
  • I am having the same problem. What is the suggested alternative? Using a nested list, particularly when I only need one sub-item, is a waste of space – Jeff Dec 4 '12 at 22:13
  • 1
    Found package outlines, suits my needs... Hopefully this will help others – Jeff Dec 4 '12 at 22:41
  • See tex.stackexchange.com/questions/32182/… – Fran Jan 17 '13 at 4:23
  • Does my solution no longer answer this question? – Peter Grill Mar 25 '16 at 22:32
19

An alternative to this approach, which facilitates the production of nested lists is the outlines package. To produce a bulleted list with three levels it is as simple as

\documentclass{article}
\usepackage{outlines}
\begin{document}
\begin{outline}
 \1 Top level item
   \2 Sub item
     \3 sub sub item
\end{outline}
\end{document}

To make a numbered list (as opposed to a bulleted list) one can simply pass the enumerate option to this package

\documentclass{article}
\usepackage{outlines}
\begin{document}
\begin{outline}[enumerate]
 \1 Top level item
   \2 Sub item
     \3 sub sub item
\end{outline}
\end{document}
18

While you should not use \subitem, you can use a different name like \SubItem to achieve the desired results with some small hackery. For comparison purposes I put the two lists (one on the right uses \SubItem) in a minipage:

enter image description here

Warning:

Code:

\documentclass[11pt]{report}
\usepackage[british]{babel}
\usepackage{enumitem}

\newlist{SubItemList}{itemize}{1}
\setlist[SubItemList]{label={$-$}}

\let\OldItem\item
\newcommand{\SubItemStart}[1]{%
    \let\item\SubItemEnd
    \begin{SubItemList}[resume]%
        \OldItem #1%
}
\newcommand{\SubItemMiddle}[1]{%
    \OldItem #1%
}
\newcommand{\SubItemEnd}[1]{%
    \end{SubItemList}%
    \let\item\OldItem
    \item #1%
}
\newcommand*{\SubItem}[1]{%
    \let\SubItem\SubItemMiddle%
    \SubItemStart{#1}%
}%

\begin{document}
\begin{minipage}[t]{0.4\linewidth}
    \begin{itemize}
     \item{First item}
      \begin{itemize}
        \item{First subitem}
        \item{Second subitem}
        \item{Third subitem}
      \end{itemize}
      \item{Second item}
      \item{Third item}
    \end{itemize}
\end{minipage}
%
\begin{minipage}[t]{0.4\linewidth}
    \begin{itemize}
      \item{First item}
      \SubItem{First subitem}
      \SubItem{Second subitem}
      \SubItem{Third subitem}
      \item{Second item}
      \item{Third item}
    \end{itemize}
\end{minipage}
\end{document}
  • 14
    I'd never recommend doing it this way. A nested list is the way to go. – egreg Nov 25 '12 at 22:36
  • Sorry, but I didn't see any difference between both lists in your figure. What did I miss? – Danilo Gregorin Aug 29 '17 at 20:19
  • 1
    @DaniloGregorin: That is exactly the point. The one on the left is produced using a nested list, the one on the right is produced using the \SubItem macro defined here, which is what the question was all about. – Peter Grill Sep 1 '17 at 0:09
  • Oh, now I see. Got confused with the English, but now I understand. Thank you very much – Danilo Gregorin Sep 2 '17 at 1:22
2

I appreciated fuzzybear3965's answer, and I think it could also be modified to this:

\documentclass{article}
\usepackage{outlines}
\begin{document}
  \begin{description}
    \item[An_Item_Which_Should_Be_Displayed_As_Usual]
    \begin{outline}
      \begin{description}
        \item[An_Item_Which_Sould_Be_Indented_Below_The_First_One]
      \end{description}
    \end{outline}
  \end{description}
\end{document}
2

How about doing something like this?

No need to use additional package, just defining it as a new command. It needs to be in extra brackets, otherwise new indent is applied to all items afterwards.

\documentclass[11pt]{report}
\usepackage[british]{babel}
%\usepackage{enumitem}

\begin{document}

\newcommand{\SubItem}[1]{
    {\setlength\itemindent{15pt} \item[-] #1}
}


\begin{itemize}
  \item{First item}
    \SubItem{First subitem}
    \SubItem{Second subitem}
    \SubItem{Third subitem}
  \item{Second item}
  \item{Third item}
\end{itemize}

\end{document}

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.