I know it's possible with the enumitem
package, to modify the list label to a custom format.
I've hacked together solutions to a couple of other questions I found on StackExchange to give me the 'solution' below.
Whilst it's the output I want, the code in the preamble is not very concise.
Is it possible do the same thing (or similar) using only the \newlist
and \setlist
commands from enumitem
(and any other commands from enumitem
I might need)?
\documentclass[a4paper,10pt]{article}
\usepackage{enumitem}
\newcommand{\changeitem}{%
\let\latexitem\item
\renewcommand\item[1][]{\latexitem\relax{##1 --} }%
}
\newlist{steps}{enumerate}{1}
\setlist[steps]{label=\textit{Step \arabic*:},leftmargin=*}
\newenvironment{labelledsteps}[1][]
{\begin{steps}[before=\changeitem,#1]}
{\end{steps}}
\begin{document}
\begin{labelledsteps}
\item[First Label] First list item \newline
Still first list item
\item[Second Label] Second list item
\item[Third Label] Third list item
\end{labelledsteps}
\end{document}
\let\latexitem\item
in the preamble outside of the\changeitem
macro. That way,\changeitem
will operate each time on the standard LaTeX\item
. As you have formulated it, each new\changeitem
will be relative to the current definition of\item
. – Steven B. Segletes Apr 3 '15 at 15:20labelledsteps
does with respect to steps, nor \changeitem, apart from adding an endash after t he label, which it would be as simple doing by hand and the label as ordinary text. Or do I miss something? – Bernard Apr 3 '15 at 15:30enumitem
package then? Specifically, I can't have a#1
typed argument in the\setlist
command when I'm setting the label text? – Jack B Apr 4 '15 at 15:58