Text FormattingBeginning the count of an enumerated list at 0

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Beginning the count of an enumerated list at 0

Post by thedoctor818 »

I have a doc that has several enumerated lists. For most of those, I wish for the counting to start at 0, i.e. I want the first number of the list to be 0, rather than 1. However, there is one list (corresponding to the list beginning with `Season 30B') that I would like to be counted in the `usual' way; i.e. with the count starting at 1.

Also, on a slightly different topic, though related, is it possible to typeset an itemize list with empty square boxes instead of the default filled in square boxes?

Below is a sample code of what I currently have for question number 1.

Code: Select all

\documentclass[12pt,a4paper]{report}
\begin{document}

\chapter{The Tenth Doctor}
\section{Season 30.}
\begin{enumerate}
\item Voyage of the Damned
\item Partners in Crime
\item The Fires of Pompeii
\item The Sontaran Strategem
\item The Poison Sky
\item The Doctor's Daughter
\item The Unicorn and the Wasp
\item Silence in the Library
\item Forest of the Dead
\item Midnight
\item Turn Left
\item The Stolen Earth
\item Journey's End
\end{enumerate}

\section{Season 30B.}
\begin{enumerate}
\item The Next Doctor
\item Planet of the Dead
\item The Waters of Mars
\item The End of Time--Part I
\item The End of Time--Part II
\end{enumerate}

\end{document}
So, for the 1st list, I would like the count to start at 0, & for the 2nd, to start at 1. I have many other lists, & for all the rest of them--I want the count to also start at 0.

Thanks in advance for the help.
-the Doctor
-Michael D

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

Beginning the count of an enumerated list at 0

Post by gmedina »

Hi,

both problems can be easily solved by using the enumitem package. An example:

Code: Select all

\documentclass[12pt,a4paper]{report}
\usepackage{amssymb}
\usepackage{enumitem}

% the new itemize-like list using a square
\newlist{sqitemize}{itemize}{10}
\setlist[sqitemize]{label=$\square$}

\begin{document}

\chapter{The Tenth Doctor}
\section{Season 30.}

\begin{enumerate}[start=0]
\item Voyage of the Damned
\item Partners in Crime
\item The Fires of Pompeii
\item The Sontaran Strategem
\item The Poison Sky
\item The Doctor's Daughter
\item The Unicorn and the Wasp
\item Silence in the Library
\item Forest of the Dead
\item Midnight
\item Turn Left
\item The Stolen Earth
\item Journey's End
\end{enumerate}

\section{Season 30B.}
\begin{enumerate}
\item The Next Doctor
\item Planet of the Dead
\item The Waters of Mars
\item The End of Time--Part I
\item The End of Time--Part II
\end{enumerate}

\begin{sqitemize}
\item The Next Doctor
\item Planet of the Dead
\item The Waters of Mars
\item The End of Time--Part I
\item The End of Time--Part II
\end{sqitemize}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Re: Beginning the count of an enumerated list at 0

Post by thedoctor818 »

Thanks a lot gmedina, that is exactly what i was looking for. :D
-Michael D
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Beginning the count of an enumerated list at 0

Post by localghost »

Then please be so kind and mark the topic accordingly.


Thorsten
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Beginning the count of an enumerated list at 0

Post by thedoctor818 »

Thorsten, I am sorry that I did not mark this post appropriately at the time. However, now I have a new question, that still is relevant & related to the original question. I am trying to typeset an an enumerated list with the aforementioned sqitemized lists embedded within it, and am getting no results.

The error code says:"Undefined control sequence."

Below is a sample of what I have tried.

Code: Select all

\documentclass[a4paper,11pt,twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[left=1.75cm, right=1.50cm, top=1.50cm, bottom=3.00cm]{geometry}
\usepackage{enumitem}

% the new itemize-like list using a square
\newlist{sqitemize}{itemize}{10}
\setlist[sqitemize]{label=$\square$}

\title{LITURGICAL MUSIC LIST.}
\author{The Doctor}
\date{\today}

\begin{document}

\section{The Month of January.}
\begin{sqitemize}
  \item 06 JANUARY--THE THEOPHANY OF OUR LORD, GOD AND SAVIOUR JESUS CHRIST.
    \begin{sqitemize}
      \item First Antiphon
      \item Second Antiphon
      \item Apolytikion
      \item Kontakion
        \begin{itemize}
          \sqitem CCCVariant
          \sqitem Samopodoben
        \end{itemize}
        \item Prokeimenon \& Alleluia
        \item Hymn to the Theotokos
    \end{sqitemize}
\end{sqitemize}
Before, the first set of list enviornments were just itemize, I think. Thanks for any help I can get on this.
-Michael D
torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Beginning the count of an enumerated list at 0

Post by torbjorn t. »

First, to use the symbol \square you have to load the amssymb package. Second, replace \sqitem with \item, the former isn't defined. (Third, you had forgotten the \end{document} in your code.)

This compiles:

Code: Select all

\documentclass[a4paper,11pt,twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{amssymb}
\usepackage[left=1.75cm, right=1.50cm, top=1.50cm, bottom=3.00cm]{geometry}
\usepackage{enumitem}

% the new itemize-like list using a square
\newlist{sqitemize}{itemize}{10}
\setlist[sqitemize]{label=$\square$}

\title{LITURGICAL MUSIC LIST.}
\author{The Doctor}
\date{\today}

\begin{document}

\section{The Month of January.}
\begin{sqitemize}
  \item 06 JANUARY--THE THEOPHANY OF OUR LORD, GOD AND SAVIOUR JESUS CHRIST.
    \begin{sqitemize}
      \item First Antiphon
      \item Second Antiphon
      \item Apolytikion
      \item Kontakion
        \begin{itemize}
          \item CCCVariant
          \item Samopodoben
        \end{itemize}
        \item Prokeimenon \& Alleluia
        \item Hymn to the Theotokos
    \end{sqitemize}
\end{sqitemize}
\end{document}
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Re: Beginning the count of an enumerated list at 0

Post by thedoctor818 »

Thanks for your help. That was exactly what I needed.
-Michael D
torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Beginning the count of an enumerated list at 0

Post by torbjorn t. »

You're welcome.

A little forum technical note: To mark a thread as solved, you have to edit the initial post and select the green check mark as post icon, only then will the check mark appear in the thread listing.
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Beginning the count of an enumerated list at 0

Post by Montag »

Just a sidenote: If I understood the initial request correctly, the enumitem-package isn't really needed. A simple

Code: Select all

\begin{enumerate}\setcounter{enumi}{0}
\item test
\item abc
\end{enumerate}
also works. Of course, for a lot of lists it's much more comfortable to use enumitem.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Re: Beginning the count of an enumerated list at 0

Post by thedoctor818 »

Thanks for straightening up my confusion on letting you all know my question has indeed been answered.
-Michael D
Post Reply