TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The following code uses the etoolbox package to convert a list a,b,c into an internal list (called \mylist) and then typesets that with colons: a:b:c:. However, when I load the etextools package (by uncommenting the second line), I get no list output.

A list:

I suspect it is is a bug since etextools claims to depend on etoolbox. Is this a bug or am I doing something wrong? In either case, how can I use \dolistloop with etextools (which I want for goodies like \expandnext)?


  • \show\mylist produces the same output a|b|c| in both cases, so the problem is with \dolistloop which expands to \forlistloop\do
  • The \forlistloop command becomes substantially more complicated when etextools is used.
  • This question might be relevant (but not obviously).
share|improve this question
The \DeclareCmdListParser\listloop{|} command in etextools.sty is responsible for changing \forlistloop. Not sure yet why this breaks the behaviour. – mforbes Mar 26 '12 at 22:12
If one is committed to using etextools, then \listloop{\mylist} works where \dolistloop{\mylist} fails. I would still like code that works with and without etextools. – mforbes Mar 26 '12 at 22:19
Just a note that this bug has been noticed before. I also sent a message to Florent Chervet mentioning this bug. – mforbes Mar 28 '12 at 4:13
up vote 7 down vote accepted

This might be a bug in the etextools package. In fact, \forlistloop is currently redefined in a way incompatible with the etoolbox package. Hence, try:

share|improve this answer
This does not explain what the problem is, but is a reasonable practical solution (though may create other issues with etextools). Hopefully the maintainer will step in, confirm the bug, and have a suggestion for fixing it. – mforbes Apr 12 '12 at 17:44
@mforbes: Both the etoolbox package and the etextools package define \forlistloop, but unfortunately not with the same argument signature. This is the problem. – mhp Apr 12 '12 at 21:07
@mforbes: If you need the \dolistloop of the etoolbox package, but otherwise the \forlistloop of the etextools package don’t restore \forlistloop and use \patchcmd to replace \forlistloop with \origforlistloop in the definition of \dolistloop. – mhp Apr 13 '12 at 6:29

If you are willing to use catoptions package, you can do

%\usepackage{etoolbox} % you may load this if you like
%\usepackage{etextools} % load if you like

% Add these elements to list container \mylist:

% User callback for every item in \mylist. Don't print the last colon (:):

% Do the looping over elements of \mylist. The star (*) form of \indrisloop expects
% a macro whose top level expansion contains the list items:
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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