2

I am including, using the enumerate environment, some sections from legislation.

In legislation, it is common to indicate subsections which were added later through the use of letters. So, for example, we might have:

5    Awesome section

(1)  This subsection existed from the beginning.
(1A) This subsection was inserted later.
(2)  And we continue with the original Act

I'm having trouble inserting '(1A)' as an enumerate counter.

When I use the enumerate package, and do:

\begin{enumerate}[(1A)]

the package appears to treat 'A' as the counter, and outputs '(AA)'.

When I try to use setcounter, as in:

\begin{enumerate}
    \setcounter{enumi}{1A}

I get

! Package calc Error: `A' invalid at this point.

How can I insert (1A), or similar letter number combinations, as an enumerate counter?

I'm not awfully fussed that it actually count correctly; I'm just after identical formatting to a normal enumerate environment.

sapi
  • 571
  • Is 1A not rather a sub-enumerate environment, although one should not use lists with just one entry. If there are more of them however, I would use \begin{enumerate} again to indicate the additions, with some redefined counter enumii –  Jun 09 '14 at 09:45
  • You can not use setcounter{enumi}{1A} with a non number argument. And it is\labelenumi` you have to change –  Jun 09 '14 at 09:46

2 Answers2

2

Immediately after posting my question, I realised the answer: use the optional argument to \item.

In other words:

\item[(1A)] This subsection was inserted later.
sapi
  • 571
2

This introduces a command \addeditem which uses itemtopnumber itemsubletter, i.e. 1A 1B etc. if necessary, however there is some 'bug' that the counter is not correctly advanced, I try to figure out why, so that one has to reset it manually at the moment.

\documentclass[paper=a4,12pt]{scrbook}

\newcounter{itemadded}
\setcounter{itemadded}{0}


\newcommand{\addeditem}{%
\addtocounter{enumi}{-1}%
\stepcounter{itemadded}
\let\LaTeXStandardLabelEnumi\labelenumi%
\renewcommand{\labelenumi}{\textbf{(\arabic{enumi}\Alph{itemadded})}}%
\item 
% Switch back to old labelling 
\let\labelenumi\LaTeXStandardLabelEnumi%
}%


\let\LaTeXStandardEnumerateBegin\enumerate
\let\LaTeXStandardEnumerateEnd\endenumerate

\renewenvironment{enumerate}{%
\LaTeXStandardEnumerateBegin%
\setcounter{itemadded}{0}
}{%
\LaTeXStandardEnumerateEnd%
}%


\begin{document}

\begin{enumerate}
\item First
\addeditem First added
\addeditem Second added
\item Next item 
\item Third item \setcounter{itemadded}{0}
\addeditem Another subitem added
\end{enumerate}


\begin{center}
\huge Just a repeat without resetting \texttt{itemadded}
\end{center}

\begin{enumerate}
\item First
\addeditem First added
\addeditem Second added
\item Next item 
\item Third item
\addeditem Another subitem added
\end{enumerate}


\end{document}

enter image description here

  • I know, that I have to write \newcounter{itemadded}[enumi] and \refstepcounter{itemadded} but it does not work->>> Why? –  Jun 09 '14 at 10:32