I am using the enumerate
environment, and I want to have my lists start on 1.1. instead of 1., and 2.1. instead of 2. How can I hide the first level?
You can either add the numbering locally by using the optional argument to \item[..]
, or use a global change using enumitem
's label=<key>
.
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label={\arabic*.1.}]
\item First
\item Second
\item Third
% Done with the 1. suffix; revert back to regular enumerate labelling
\renewcommand{\labelenumi}{\arabic{enumi}.}
\item Last
\end{enumerate}
\begin{enumerate}
\item[1.1.] First
\stepcounter{enumi}
\item Second
\item[2.2.] Third
\item Last
\end{enumerate}
\end{document}
\item
-level changes are also possible, like in the first example above, where the labelling mechanism can be changed mid-enumerate
to drop (say) the 1.
suffix.
Note that using the optional argument to \item
doesn't step the level counter enumi
.
This uses a mix with manipulation the enumeration depth counter and enumitem
and sets the higher
level counter enumi
accordingly.
\documentclass{article}
\usepackage{etoolbox}
\usepackage{enumitem}
\begin{document}
\makeatletter
\AtEndEnvironment{enumerate}{%
\global\@enumdepth 0
}
\newcommand{\incenumdepth}[1][1]{%
\advance \@enumdepth \@ne%
\setcounter{enum\@roman{\@enumdepth}}{#1}%
}
\makeatother
\incenumdepth[1]
\begin{enumerate}[label*={\arabic*.}]
\item One
\item Two
\item Three
\item Four
\item Five
\end{enumerate}
\incenumdepth[3]
\begin{enumerate}[label*={\arabic*.}]
\item One \makeatletter \the\@enumdepth\makeatother
\item Two
\item Three
\item Four
\item Five
\end{enumerate}
\end{document}
1
in2.1
represent? Chapter number? Section number? Or just some fixed value? – Werner Mar 3 '16 at 15:32\savebox\item
when I want to hide that point? – ahorn Mar 3 '16 at 16:06