1

I'm working with a custom class file that defines a subsection environment. The subsection environment includes the following:

\begin{list}{$\cdot$}{\leftmargin=0em}
  \itemsep -0.5em \vspace{-0.5em}
}{
  \end{list}

The class file is very old, so maybe now you would use itemize or enumerate instead of list.

When I add items to the list, they are all on the same level. I want to make some of the bullets sub-bullets relative to other bullets. Obviously in MS Word you would just tab. However, I'm not sure how to do that here. I tried the following:

\setlength{\itemindent}{0.25in} 

However, this only indents, so if the item is more than a single line, the text is not lined up under the bullet. It overshoots to the left.

I need something that will allow me to move the entire item rather than just indent the first line. What would allow me to do this? I tried using \itemize to make a nested list but it didn't seem to work.

1 Answer 1

0

It would be wise to use the standard list environments, since it would allow you to branch out using packages that provide a more stable way of managing lists and they way they could be nested.

Here's an option to add an \indentlist{<len>} parameter to your lists. Similar to a \begin{list}...\end{list} approach, you'd use \indentlist{<len>} to indent the remaining part of the list by <len>. If you want to revert back to the previous list indents, use \indentlist{-<len>}.

enter image description here

\documentclass{article}

\usepackage{lipsum}

\makeatletter
\newcommand{\indentlist}[1]{%
  \par% Force new paragraph
  \addtolength{\@totalleftmargin}{#1}% Indent entire list
  \addtolength{\linewidth}{-#1}% Reduce line width by indent
  \parshape \@ne \@totalleftmargin \linewidth
}
\makeatother
\begin{document}

\begin{list}{$\cdot$}{
  \leftmargin=0em
  \itemsep=-0.5em
  \vspace{-0.5em}
}
  \item First item
  
  \item \lipsum*[1][1-2]
  
  \indentlist{0.25in}

    \item Third item
    
    \item \lipsum*[1][1-2]

    \indentlist{0.25in}

      \item Fifth item
    
      \item \lipsum*[1][1-2]
      
    \indentlist{-0.25in}
  
    \item Seventh item
  
  \indentlist{-0.25in}
  
  \item Eighth item
\end{list}

\end{document}
3
  • That seems to work but an oddity is that \indentlist{0.25in} applies to both the line directly above and following in my document. So, if I have 5 items and want every item after the first to be a sub-bullet, I need to put \indentlist{0.25in} in between the second and third items. That's easy to do, but it seems odd that \indentlist{0.25in} is grabbing the line above.
    – Pond892
    Commented Jan 23, 2021 at 17:39
  • @Pond892: That's because you're condensing your code and removing the vertical separation (blank lines) I've added to my example. I've updated \indentlist to insert a \par which would be similar. This should fix your issue.
    – Werner
    Commented Jan 23, 2021 at 17:44
  • @Warner: That works, thanks!
    – Pond892
    Commented Jan 23, 2021 at 17:49

You must log in to answer this question.

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