5

I want to have something that looks like this:

1.
  A.
  B.
  C.
  D.
2.
  F.
  G.
  H.
  J.
3.
  A.
  B.
  C.
  D.

And it keeps on cycling. Notice that the letters are sometimes not consecutive.

So far I have

\renewcommand{\labelenumii}{\textbf{\Alph{enumii}.}}

\begin{enumerate}
\item
\begin{enumerate}
\item foo
\item foo
\item foo
\item foo
\end{enumerate}
\item
\begin{enumerate}
\item foo
\item foo
\item foo
\item foo
\end{enumerate}
\end{enumerate}

But obviously this just cycles through A, B, C, and D over and over.

  • 1
    What determines whether the second-level items are numbered as A, B, C, and D vs. as opposed to F, G, H, and J? What determines which letters (e.g., E and I in your example) are skipped? What determines when the letters should restart (at A, presumably)? Are there always four second-level items below any first-level item? – Mico Apr 10 '15 at 15:20
  • It always starts at A. There are always four second-level items. It will always go A,B,C,D,F,G,H,J and then repeat. – Nelson Apr 10 '15 at 15:24
4

You can use series facility of enumitem

\documentclass{Article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}
\item
\begin{enumerate}[label=\Alph*.,series=myseries]
\item foo
\item foo
\item foo
\item foo
\end{enumerate}
\item
\begin{enumerate}[resume*=myseries,start=6]    %% start at F.
\item foo
\item foo
\item foo
\item foo
\end{enumerate}
\item
\begin{enumerate}[resume*=myseries,start=1]    %% start at A. again
\item foo
\item foo
\item foo
\item foo
\end{enumerate}
\end{enumerate}
\end{document}

enter image description here

  • If they are random, then use \item[J.], for example. – user11232 Apr 10 '15 at 15:37
  • how is myseries defined? – Nelson Apr 10 '15 at 15:49
  • @Nelson In the first enumerate like ,series=myseries. For details, please see enumitem documentation, section 3.5, page 6. – user11232 Apr 10 '15 at 15:57
4

Define a new counter representation that uses the counter's value modulo 8. The easiest way to do it is with expl3. Then with enumitem define a suitable list.

\documentclass{article}
\usepackage{enumitem,xparse}

\newlist{nelson}{enumerate}{1}
\setlist[nelson,1]{label=\nelsonalph*.,resume}
\AddEnumerateCounter{\nelsonalph}{\donelsonalph}{D}
\newcommand{\nelsonalph}[1]{\expandafter\donelsonalph\csname c@#1\endcsname}

\ExplSyntaxOn
\cs_new:Npn \donelsonalph #1
 {
  \int_case:nn { \int_mod:nn { #1 } { 8 } }
   {
    {0}{J}
    {1}{A}
    {2}{B}
    {3}{C}
    {4}{D}
    {5}{E}
    {6}{F}
    {7}{G}
   }
 }
\ExplSyntaxOff

\begin{document}

\begin{enumerate}
\item
\begin{nelson}
\item foo
\item foo
\item foo
\item foo
\end{nelson}
\item
\begin{nelson}
\item foo
\item foo
\item foo
\item foo
\end{nelson}
\item
\begin{nelson}
\item foo
\item foo
\item foo
\item foo
\end{nelson}
\end{enumerate}
\end{document}

enter image description here

2

Here's an option using enumitem and your own counter:

enter image description here

\documentclass{article} 

\usepackage{enumitem}

\newcounter{cycleenum}
\newcommand{\cyclealph}[1]{%
  \ifcase\value{#1}% 0
  \or A% 1
  \or B% 2
  \or C% 3
  \or D% 4
  \or F% 5
  \or G% 6
  \or H% 7
  \or J% 8
  \or \setcounter{#1}{1}\cyclealph{#1}%
  \fi}
\newcommand{\cycleitem}{\refstepcounter{cycleenum}\item[\textbf{\cyclealph{cycleenum}.}]}
\begin{document}


\begin{enumerate}
  \item
  \begin{enumerate}[series=cyclealph]
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
  \end{enumerate}

  \item
  \begin{enumerate}[resume,series=cyclealph]
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
    \cycleitem foo
  \end{enumerate}
\end{enumerate}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.