[texhax] Finding the widest string

Heiko Oberdiek heiko.oberdiek at googlemail.com
Tue May 4 15:58:09 CEST 2010


On Tue, May 04, 2010 at 11:39:44AM +0200, Reinhard Kotucha wrote:

> In order to process comma separated lists, the \@for loop defined
> in texmf-dist/source/latex/base/ltcntrl.dtx is much easier to use.
> 
> % \@for NAME := LIST \do {BODY} : Assumes that LIST expands to A1,A2,
> %      ... ,An . 
> %      Executes  BODY  n  times, with  NAME = Ai  on the i-th iteration.
> %      Optimized for the normal case of n = 1.  Works for n=0.

Or package kvsetkeys support the parsing of comma separated lists.
It also removes spaces at the begin and end of an entry and ignores
empty entries.

> BTW, it's also quite odd to allocate new box- and dimen-registers each
> time the macro is called.

Yes it should be moved outside the macro definition.

FYI, the same question was asked in the newsgroup comp.text.tex,
the thread there contains other solution examples.

Yours sincerly
  Heiko Oberdiek


More information about the texhax mailing list