5

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.

2
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Commented Aug 14, 2014 at 21:29
  • Hi @ChristianHupfer - I've added the MWE, but I see that grayshade has already provided exactly what I needed. Thanks for the welcome, I'm sure I'll be back.
    – Steve V.
    Commented Aug 15, 2014 at 3:01

1 Answer 1

6

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.

2
  • Why not simply define \renewcommand\item[1][]{\olditem##1\dotfill} without the ##2?
    – Aditya
    Commented Aug 15, 2014 at 5:13
  • @Aditya thanks for the suggestions - I was in fact keeping changes to the OPs MWE to a minimum. Trying to make the \renewcommand as easy to understand as possible, I guess one might also write \renewcommand\item[1]{\olditem##1\dotfill} making the argument compulsory and requiring to write \item{Description} Value.
    – greyshade
    Commented Aug 15, 2014 at 7:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .