Format for enumerate environment

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Format for enumerate environment

Nitecki, Zbigniew H.
This is undoubtedly a stupid question, but bear with me.

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 use mdwlist alone with the same initial \begin{enumerate}[1.] I get an immediate missing item error.
  
The best outcome I managed was to \usepackage{enumerate} together with \mdwlist;  with the initial \begin{enumerate}[1.] :
if I don’t try to put [1.] after the \resume{enumerate} I get a good listing, but the first part of the list is labeled as desired (1. First) but the second part is
indented, and labeled parenthetically ( (3) Third ).  I’ve attached the minimal example with this configuration.

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

1. First item
2. Second item
We pause for a break
3. Third item
4. Fourth item

?



Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/





----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

test1.tex (564 bytes) Download Attachment
test1.pdf (55K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Format for enumerate environment

William Slough
I don't claim any expertise on these packages, but does this produce what you want?

   \resume{enumerate}[{[1.]}]

 Please don't ask me to explain the meaning of the syntax though: I got this with some experimentation!

Best regards,

Bill Slough

On Wed, Aug 7, 2019 at 5:28 PM Nitecki, Zbigniew H. <[hidden email]> wrote:
This is undoubtedly a stupid question, but bear with me.

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 use mdwlist alone with the same initial \begin{enumerate}[1.] I get an immediate missing item error.
  
The best outcome I managed was to \usepackage{enumerate} together with \mdwlist;  with the initial \begin{enumerate}[1.] :
if I don’t try to put [1.] after the \resume{enumerate} I get a good listing, but the first part of the list is labeled as desired (1. First) but the second part is
indented, and labeled parenthetically ( (3) Third ).  I’ve attached the minimal example with this configuration.

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

1. First item
2. Second item
We pause for a break
3. Third item
4. Fourth item

?



Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Reply | Threaded
Open this post in threaded view
|

Re: Format for enumerate environment

Ross Moore-3
In reply to this post by Nitecki, Zbigniew H.


On 8 Aug 2019, at 8:28 am, Nitecki, Zbigniew H. <[hidden email]> wrote:

This is undoubtedly a stupid question, but bear with me.

Nothing stupid about it.


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}


?



Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/




<test1.tex><test1.pdf>----------- Please Consult the Following Before Posting -----------
TeX FAQ: https://protect-au.mimecast.com/s/Hi5kCWLVn6iXrrvLux7uua?domain=tex.ac.uk
List Reminders and Etiquette: https://protect-au.mimecast.com/s/1-WUCXLW6DiDEE3PCDCYhl?domain=sites.esm.psu.edu
List Archives: https://protect-au.mimecast.com/s/Pf4MCYW86EspVVPWFVBicH?domain=dir.gmane.org
               https://protect-au.mimecast.com/s/YAHACZY146s8KKyqfxV5y7?domain=email.esm.psu.edu
TeX on Mac OS X Website: https://protect-au.mimecast.com/s/U9YKC1WLjwsBJJKAu1neKL?domain=mactex-wiki.tug.org
List Info: https://protect-au.mimecast.com/s/gfNOC2xMRkUZ55A2HXefw8?domain=email.esm.psu.edu



----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Reply | Threaded
Open this post in threaded view
|

Re: Format for enumerate environment

"Néstor E. Aguilera"
Hi,

> On 7 Aug 2019, at 20:12, Ross Moore <[hidden email]> wrote:
>
>> On 8 Aug 2019, at 8:28 am, Nitecki, Zbigniew H. <[hidden email]> 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

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Reply | Threaded
Open this post in threaded view
|

Re: Format for enumerate environment

Nitecki, Zbigniew H.
Nestor:
Yes, I had the same problem withwhat Ross suggested, since I am creating a template for multiple use (homework assignments).
Your version works, with one caveat: just to be sure, I used a different name for the counter saving values and the command setting its value.

Thanks
Z

Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/




On Aug 8, 2019, at 7:59, Nestor Aguilera <[hidden email]> wrote:

Hi,

On 7 Aug 2019, at 20:12, Ross Moore <[hidden email]> wrote:

On 8 Aug 2019, at 8:28 am, Nitecki, Zbigniew H. <[hidden email]> 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

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
               https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Reply | Threaded
Open this post in threaded view
|

Re: Format for enumerate environment

John Thoo
In reply to this post by Nitecki, Zbigniew H.

> On Aug 8, 2019, at 12:00 PM, [hidden email] wrote:
>
> Message: 1
> Date: Wed, 7 Aug 2019 22:28:04 +0000
> From: "Nitecki, Zbigniew H." <[hidden email]>
> To: TeX on Mac OS X Mailing List <[hidden email]>
> Subject: [OS X TeX] Format for enumerate environment
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="utf-8"
>
> This is undoubtedly a stupid question, but bear with me.
>
> 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 use mdwlist alone with the same initial \begin{enumerate}[1.] I get an immediate missing item error.
>
> The best outcome I managed was to \usepackage{enumerate} together with \mdwlist;  with the initial \begin{enumerate}[1.] :
> if I don?t try to put [1.] after the \resume{enumerate} I get a good listing, but the first part of the list is labeled as desired (1. First) but the second part is
> indented, and labeled parenthetically ( (3) Third ).  I?ve attached the minimal example with this configuration.
>
> 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
>
> 1. First item
> 2. Second item
> We pause for a break
> 3. Third item
> 4. Fourth item
>
> ?
>
>
>
> Zbigniew Nitecki
> Department of Mathematics
> Tufts University
> Medford, MA 02155
>
> telephones:
> Office    (617)627-3843
> Dept.    (617)627-3234
> Dept. fax    (617)627-3966
> http://www.tufts.edu/~znitecki/

Hi.  If I understand you correctly, then what I use is the following style file:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% interitemtext.sty
%
% For inserting text between \item's in a list environment
%
% Suggested by Michel Bovani.
% <http://www.esm.psu.edu/mac-tex/MacOSX-TeX-Digests/2004/MacOSX-TeX_Digest_07-12-04.html>
%
% Useage:
%
%    \item  This is an item.
%
%    \interitemtext{This is some text not part of an item.}
%
%    \item  This is another item.

\makeatletter
\newcommand{\interitemtext}[1]{%
\begin{list}{}
{\itemindent 0mm\labelsep 0mm
\labelwidth 0mm\leftmargin 0mm
\addtolength{\leftmargin}{-\@totalleftmargin}}
\item #1
\end{list}}
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


---John.

(I receive the digest.)

-----------------------------------------------------------------------
*PRIMUS*
The all-around best journal for undergraduate mathematics teaching.
<http://www.tandfonline.com/toc/upri20/current>  or Twitter @ReadPRIMUS

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex