6

I'm trying to define the following environment:

\newlist{aims}{enumerate}{1}
\setlist[aims,1]{
      label={~ \textbullet ~ ~ ~ ~ ~\nth{\arabic*} best  ~~~ =},
      leftmargin=*,
      align=left,
 labelsep=10mm,
 }

What I'd like to have is automatic 1st, 2nd, 3rd... and so on. The code above returns an error.

/home/snake91/Desktop/.econ.tex.swp:295: Missing number, treated as zero.
<to be read again> 
               \arabic 
l.295 \item
        0.000425%

[EDIT]

\documentclass[a4paper, left=5cm, right=5cm, 10pt]{article}
\usepackage{enumitem}
\usepackage[super]{nth}
\newlist{aims}{enumerate}{1}
\setlist[aims,1]{
    label={~ \textbullet ~ ~ ~ ~ ~\arabic* best estimator ~~~ =},
    leftmargin=*,
    align=left,
    labelsep=10mm,
    }
\usepackage[T1]{fontenc}
\begin{document}

\begin{aims}
    \item 
\end{aims}
\end{document}
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Alan Munn Mar 15 '15 at 16:24
  • Thanks! This is the best way to get quick answers on the site. – Alan Munn Mar 15 '15 at 16:39

2 Answers2

6

For ordinal lists with the enumitem package, you also need to use the moreenum package:

\documentclass{article}
\usepackage{enumitem}
\usepackage{moreenum}
\begin{document}
\begin{enumerate}[label=\raisenth*] 
\item foo
\item bar
\end{enumerate}
\end{document}

If you don't want the superscripted ordinal, use \levelnth* instead of \raisenth*.

See What's the quickest way to write "2nd" "3rd" etc in LaTeX? for extensive discussion of ordinals in LaTeX more generally.

Some comments on your actual example: Rather than use non-breaking spaces in the label, I would use \hspace{} with some amount expressed in em. Also, instead of a space before the bullet, you should set the itemindent to a value:

\documentclass{article}
\usepackage{enumitem}
\usepackage{moreenum}
\newlist{aims}{enumerate}{1}
\setlist[aims,1]{
    label={\textbullet\hspace{3em}\raisenth* best estimator\hspace{2em}=},
    leftmargin=*,
    labelindent=1em,
    align=left,
    labelsep=10mm,
    }
\begin{document}
Alan Munn
  • 218,180
2

If you're ever brave enough to venture outside of enumitem territory, go rogue with formatting the enumerate counter using fmtcount:

enter image description here

\documentclass{article}
\usepackage{fmtcount}
\newenvironment{aims}
  {\begin{enumerate}
   \renewcommand{\theenumi}{\ordinal{enumi}}
   \renewcommand{\labelenumi}{\textbullet~\theenumi: }% label = \textbullet~\ordinal*
   \renewcommand{\makelabel}[1]{\makebox[4em][l]{##1}}}% align = left
  {\end{enumerate}}
\begin{document}

\begin{aims}
  \item \item \item \item 
\end{aims}

\end{document}
Werner
  • 603,163