3

I was wondering how to choose the letter in an alpha enumerated list. This is what I have so far

\begin{enumerate}[label=(\alph*)]

    % Part (a)
    \item

    % Part (d)
    \item

    % Part (f)
    \item

\end{enumerate}

the output gives me

(a)
(b)
(c)

but I want it to give me

(a)
(d)
(f)

Is there another argument I have to provide in the \begin statement? or can I give each individual \item and argument?

5
  • Is it really "enumerated" if there is nothing sequential about the labels? By the way, welcome to the site. And you can say \item[(d)] to override the default label. Mar 30, 2015 at 18:29
  • I see your point, but it's for a HW assignment and instead of having to type out 5.1.1a, 5.1.1d, 5.1.1f I'd like to just use an "enumerated" list
    – user75287
    Mar 30, 2015 at 18:36
  • 2
    @StevenB.Segletes -- there's a down-side to giving an optional argument to \item -- if you want to hyperlink it, that won't work, although \label and \ref will probably be resolved correctly. hyperref will only link to elements identified by a counter, and by using the optional value on \item, that removes it from counter control. Mar 30, 2015 at 18:39
  • @user75287 -- before each non-continuous \item, increase the value of the relevant counter by the necessary increment. in this case, that should probably be \addtocounter{enumi}{1}. Mar 30, 2015 at 18:41
  • 1
    You could, for those cases where needed, bump the counter (which will make barbara happy): % Part (a) \item \addtocounter{enumi}{2} % Part (d) \item \addtocounter{enumi}{1} % Part (f) \item. If the list is nested, the relevant counter might be enumii or enumiii instead. Mar 30, 2015 at 18:42

2 Answers 2

5

Of course, you can manually specify the value of the label. If your labels have some regularity, you can add it to the optional argument of the enumerate environment:

\documentclass{article}

\usepackage{mathtools}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label = (\alph*)]
\item A first item.
\item[(d)] Second item.
\item[(f)] A third item.
\end{enumerate}
\vskip 1cm
\begin{enumerate}[label = (\alph*)\addtocounter{enumi}{2}]
\item A first item.
\item Second item. 
\item A third item. 
\end{enumerate}

\end{document} 

enter image description here

2

The following allows you to set the next item to suit your needs:

enter image description here

\documentclass{article}

\usepackage{enumitem,xparse}

\ExplSyntaxOn
\DeclareExpandableDocumentCommand \AlphToNum { m }
{
   \int_from_alph:n { #1 }
}
\ExplSyntaxOff

\makeatletter
\newcommand{\nextitem}[1]{\setcounter{enum\romannumeral\enit@depth}{\numexpr\AlphToNum{#1}-1}}
\newcommand{\thisitem}[1]{\nextitem{#1}\item}
\makeatother

\begin{document}

\begin{enumerate}[label=(\alph*)]
  \item % Part (a)
  \item % Part (b)
  \item % Part (c)
\end{enumerate}

\begin{enumerate}[label=(\alph*)]
  \item % Part (a)
  \nextitem{d}
  \item % Part (d)
  \thisitem{f} % Part (f)
\end{enumerate}

\end{document}

\AlphToNum{<alph>} converts <alph> to a number (you can use capital letters as well, like D or F, or even -F). This conversion capability is thanks to expl3.

\nextitem "prepares" the next \item, while \thisitem sets the next item. It depends on your preference.

Cross-referencing is maintained, as one would expect.

You must log in to answer this question.

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