Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've always used latex for writing papers and documents but I'm not really expert of templates and styles.

Currently I'm working on a document and I'm using a template that was provided by a colleague. Unfortunately when I use \begin{enumerate} the generated list contains numbers that are not followed by points (e.g. I see 1 instead of 1.).

I tried to look in the cls file and I found the following code, however I wasn't able to fix it.

%% Redefine enumerate environment for closer spacing
\renewenvironment{enumerate}%
{\begin{list}{\arabic{enumi}}%
      {\setlength{\leftmargin}{2.5em}%
       \setlength{\itemsep}{-\parsep}%
       \setlength{\topsep}{-\parskip}%%
       \usecounter{enumi}}%
 }{\end{list}}

How can I fix it?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

To answer the above question we only need to put a dot after \arabic{enumi}

%% Redefine enumerate environment for closer spacing
\renewenvironment{enumerate}%
{\begin{list}{\arabic{enumi}.}% <------ dot here
      {\setlength{\leftmargin}{2.5em}%
       \setlength{\itemsep}{-\parsep}%
       \setlength{\topsep}{-\parskip}%%
       \usecounter{enumi}}%
 }{\end{list}}

Using the enumitem package one could write:

\begin{enumerate}[label=\arabic{*}.,topsep=-\parskip,itemsep=-\parsep,leftmargin=2.5em]
\item 
\end{enumerate}

Which also yields the same result.

share|improve this answer

The first argument of the list environment gives an indication of the printed counter. source2e (p 273) lists the definition as:

\list{<LABEL>}{<COMMANDS>} ... \endlist

where <LABEL> is set to \@itemlabel - the printed counter at every \item. Modifying this to \arabic{enumi}. inserts the period after the number.

You can also obtain the same result using the enumitem package:

enter image description here

\documentclass{article}
%% Redefine enumerate environment for closer spacing
\renewenvironment{enumerate}%
{\begin{list}{\arabic{enumi}.}%
      {\setlength{\leftmargin}{2.5em}%
       \setlength{\itemsep}{-\parsep}%
       \setlength{\topsep}{-\parskip}%%
       \usecounter{enumi}}%
 }{\end{list}}
\newsavebox{\mybox}
\begin{lrbox}{\mybox}
\noindent\begin{minipage}{\linewidth}
\begin{enumerate}
  \item An item
  \item An item
  \item An item
\end{enumerate}
\end{minipage}
\end{lrbox}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
\noindent\usebox{\mybox}% Original

\bigskip

% With enumitem
\begin{enumerate}[topsep=-\parskip,itemsep=-\parsep,leftmargin=2.5em,label=\arabic*.]
  \item An item
  \item An item
  \item An item
\end{enumerate}
\end{document}

The advantage with the latter, of course, is the flexibility to manage lists locally (or globally) in a consistent yet versatile way.

share|improve this answer
    
Thanks for your complete answer! I selected azetina's one because it was the first! –  Maverik Aug 28 '12 at 16:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.