In Ryan Reich's great answer to my question on onlyitems, he had LaTeX ignore an \item by setting it into a box and then not using the box, effectively discarding it:
...SNIP...
\renewcommand\item[1][]{%
% The \egroup closes off any \vbox'es from the previously ignored \item.
% The conditional \bgroup cancels it out when there aren't any.
\itemIf\bgroup\fi\egroup
\let\itemIf=\iffalse%\fi
\advance\itemsSoFar by 1 %
\onlyitemsset{utility/store tag = {}, utility/verdict/.style = {}, select/\the\itemsSoFar, #1, utility/verdict}%
\itemIf
\def\next{\expandafter\itemLaTeX\itemOptions}%
\else
% The vbox is set and then discarded, effectively ignoring an entire \item.
% This inner \itemLaTeX is necessary to avoid a glitch when we ignore the first \item of an itemize that itself contains a nested \itemize. Don't ask, I don't know.
\def\next{\setbox0=\vbox\bgroup\itemLaTeX}%
\fi
\next
}
...SNIP...
This works, but has the unfortunate side-effect of advancing the appropriate LaTeX counter, which is either good or bad, depending on how one wants to use onlyitems.
In my case, I want onlyitems to literally behave as if only the included \items are there, so that means that the counters must not be advanced. Since the implementation is list-agnostic (it should work for enumerate, revnum or any other list of \items you like to define), I cannot manually set back counters (I cannot know which are the important ones), rather I need to skip the \item entirely, without side-effects.
Thus, to repeat the title, the question is:
How can I skip an
\itemwithout any side-effect?
\itemthe termination string, and second, count\begin...\endpairs so that you don't comment out half of a nested itemize. I am not feeling up to it now, though. – Ryan Reich Nov 14 '11 at 17:03\itemsby verbatim methods", but until I answered your question, I had also always wanted to get theonlyitemsthing to work in general. If you think it's good, I'll put together a package (perhaps in December). – Ryan Reich Nov 14 '11 at 18:02