[Tex/LaTex] Numbered description list with dot leaders

descriptionlists

The problem:

I would like to create checklists for an aircraft. What I'm looking for is a way to create numbered descriptive lists with dot leaders.

Essentially, I want this, with numbers.

dot leaders


The Code:

I have this code, which I took from the above link:

\documentclass[12pt, letter]{article}

\newenvironment{specifications}{%
  \let\olditem\item%
  \renewcommand\item[2][]{\olditem##1\dotfill##2}%
  \begin{description}}{\end{description}% 
}

\begin{document}

\begin{specifications}
    \item[Input Voltage Range] 36-72 V DC
    \item[Input Current] 80 mA
    \item[Power over Ethernet] 802.3af-compliant Powered Device
\end{specifications}

\end{document}

I'm frankly not sure where to begin. I'm a novice with LaTeX – I'd prefer a simple answer to a complex one, but most of all I want to learn.

Best Answer

Simply change the descripton environment for an enumerate environment:

\documentclass[12pt, letter]{article}

\newenvironment{specifications}{%
  \let\olditem\item%
  \renewcommand\item[2][]{\olditem##1\dotfill##2}%
  \begin{enumerate}}{\end{enumerate}% 
}

\begin{document}

\begin{specifications}
    \item[Input Voltage Range] 36-72 V DC
    \item[Input Current] 80 mA
    \item[Power over Ethernet] 802.3af-compliant Powered Device
\end{specifications}

\end{document}

output

As per Aditya's comment, the contained \renewcommand statement may be simplified to only one, compulsory argument, giving:

\documentclass[12pt, letter]{article}

\newenvironment{specifications}{%
  \let\olditem\item%
  \renewcommand\item[1]{\olditem##1\dotfill}%
  \begin{enumerate}}{\end{enumerate}% 
}

\begin{document}

\begin{specifications}
    \item{Input Voltage Range} 36-72 V DC
    \item{Input Current} 80 mA
    \item{Power over Ethernet} 802.3af-compliant Powered Device
\end{specifications}

\end{document}

Which of course provides the exact same output.