[OS X TeX] Format for enumerate environment

Nestor Aguilera nestoreaguilera at gmail.com
Thu Aug 8 07:59:10 EDT 2019


Hi,

> On 7 Aug 2019, at 20:12, Ross Moore <ross.moore at mq.edu.au> wrote:
> 
>> On 8 Aug 2019, at 8:28 am, Nitecki, Zbigniew H. <Zbigniew.Nitecki at tufts.edu> wrote:
>> 
>> This is undoubtedly a stupid question, but bear with me.
> 
> Nothing stupid about it.

Agree.

>> I am trying to format an enumerated list (using the enumerate environment, and we are at the top level—this is not inside another “enumerate” environment).  I want to have the numbering in arabic followed by a period, as in 
>> 1. First item
>> 2. Second item
>> etc, but I need to interrupt the list to insert commentary/instructions.  I know about both the enumitem package (using \end{enumerate}, then \begin{enumerate}[resume} and the mdwlist package, (using \suspend{enumerate} then \resume{enumerate}.  For some reason (is it because I am using the amsart document style?) the default labelling is in parentheses, contrary to what the Latex Companion says.  
>> 
>> I can change the format back to the one I want, using \usepackage{enumerate} and \begin{enumerate}[1.], but can’t interrupt the list—at least I don’t know how: if I don’t invoke either enumitem or mdwlist, I know I have to go through contortions to resume the numbering after the comment, which I don’t quite understand (the explanation on pp 129-131 is opaque to me). 
>> 
>> If I try to use enumitem and start with \begin{enumerate}[1.], even with \usepackage{enumerate},  it tells me 1. is undefined.  
> 
>> If I try to use [1.] after \resume{enumerate}, it finds a missing item in the second part of the list.
>> 
>> Can someone give me a (hopefully straightforward) solution to the problem, so that I get
> 
> Here’s how I do it.
> 
> \begin{enumerate}[1.]
>> 1. First item
>> 2. Second item
> \end{enumerate}
> 
>> We pause for a break
> 
> \begin{enumerate}[1.]
>  \setcounter{enumi}{2}%  where the counter would be if there was no break
>> 3. Third item
>> 4. Fourth item
> \end{enumerate}

I am sure a few years ago a similar question appeared in this list, but I don't recall exactly when was that, and I don't remember whether amsart class was involved.

The problem with Ross's approach is that if the number of items in one part is changed, the following parts have to be renumbered manually. Also, the package "enumerate" changes the indentation of lists in "amsart".

What I do is before closing one part of the list is to save the counter and to recall it when resuming, much like Ross suggested but automatically.

You may also want to look at section 2.10 "Macros for list labels", p. 34 in amsclass.pdf (you could open it with "texdoc amsart" in terminal). 

So perhaps you could try the following.

In the preamble:

%----------------------------------------------
\renewcommand{\labelenumi}{\theenumi.}  % back to old amsart
\newcounter{savectr}  % save the value of any counter
\newcommand{\savectr}[1]{\setcounter{savectr}{\value{#1}}}
\newcommand{\backctr}[1]{\setcounter{#1}{\value{savectr}}}
%----------------------------------------------

and in the document:

%----------------------------------------------
\begin{enumerate}
\item First.
\item Second.
\savectr{enumi}   % or whatever counter
\end{enumerate}

Some text.

\begin{enumerate}
\backctr{enumi}   % recover the counter
\item And so on.
\end{enumerate}
%----------------------------------------------

Does it work?

Best,

Nestor



More information about the MacOSX-TeX mailing list