18

I would like to skip an \item in a sub-enumerate level. More specifically, I want the output to look something like:

1. 
     a)
     b)
     e)
     f)
     etc.

2.

However, when I use \addtocounter{enumi} (within the first \begin{enumerate} \end{enumerate} block obviously), it increases the outer counter and I get:

1. 
     a)
     b)
     c)
     d)
     etc. (no skips!)

3.

So I am looking for a way to specify which counter to increase. Greatly appreciate the help!

20

There's a counter for each level:

enter image description here

\documentclass{article}
\begin{document}
\begin{enumerate}
  \item \mbox{}
  \begin{enumerate}
    \item
    \item \addtocounter{enumii}{2}
    \item
    \item
  \end{enumerate}
  \item
\end{enumerate}
\end{document}

In the default document class(es), enumi controls the enumeration at level 1, enumii for level 2, enumiii for level 3 and enumiv for level 4.

| improve this answer | |
14

You can refer to the current enumeration counter by \@enumctr:

\documentclass{article}

\makeatletter
\newcommand{\skipitems}[1]{%
  \addtocounter{\@enumctr}{#1}%
}
\makeatother

\begin{document}
\begin{enumerate}
  \item Outer
  \begin{enumerate}
    \item Inner
    \item Inner again
    \skipitems{2}
    \item Inner again
    \skipitems{3}
    \item Inner again
  \end{enumerate}
  \item Outer again
  \skipitems{1}
  \item Let's end here
\end{enumerate}
\end{document}

enter image description here

| improve this answer | |
  • Hijacking with a follow-up question: I am using this idea but with \refstepcounter instead of \addtocounter. It works, except that it conflicts with the \hyperref package. That is, if I include \usepackage{hyperref} in the header it stops working with an error message about expecting a number (after the \skipitem). Any advice on how to make this work with \hyperref? Thanks. – Neal Young Jan 8 '18 at 21:39
  • @NealYoung Sorry, but I don't get it. Please open a fresh question with a minimal example. – egreg Jan 8 '18 at 21:59
  • Okay, here is fresh question, thanks: tex.stackexchange.com/questions/409432/… . (By the way, the conflict is not with hyperref alone, it turns out to be a conflict with hyperref and enumitem combined.) – Neal Young Jan 9 '18 at 1:52

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.