Text Formattingbug with custom label for list evironments

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
cotta
Posts: 2
Joined: Thu Jan 08, 2009 12:11 pm

bug with custom label for list evironments

Post by cotta »

Hello,

I recently started using LaTeX and tried to nest \list-environments with custom labels via \list{\textendash}.

Everything worked fine but the label for the second item within the nested \list never appeared.

Code: Select all

\begin{list}{\textbullet}
   \item 1
   \item begin{list}{\textendash}
      \item 1.1
      \item 1.2 <-- this item is diplayed without a label e.g. \textendash
      \item 1.3 <-- this item's label is displayed correctly
   \end{list}
\end{list}
Does this happen due to a bug in the list macro or am I missing some thing?
Any help would be greatly appreciated.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

bug with custom label for list evironments

Post by gmedina »

Hi,

the list environment has two mandatory arguments; the first one specifies the label used and the second one handles the spacing parameters for the list. The problem with your code is that in both list environments you are missing the second argument. In the following example I show two options: the first one, using list environments, and the second one, using customised itemize environments:

Code: Select all

\documentclass{article}

\begin{document}

\begin{list}{\textbullet}{}
   \item 1
   \item \begin{list}{\textendash}{}
      \item 1.1
      \item 1.2 
      \item 1.3 
   \end{list}
\end{list}

\begin{itemize}
\renewcommand\labelenumi{\textbullet}
\renewcommand\labelenumi{\textendash}
   \item 1
   \item \begin{itemize}
      \item 1.1 
      \item 1.2 
      \item 1.3 
   \end{itemize}
\end{itemize}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

bug with custom label for list evironments

Post by localghost »

The enumitem package simplifies the handling of list environments.


Best regards and welcome to the board
Thorsten¹
cotta
Posts: 2
Joined: Thu Jan 08, 2009 12:11 pm

Re: bug with custom label for list evironments

Post by cotta »

Thanks everyone. You really helped me with that one!
Post Reply