Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!ceblair From: ceblair@uxe.cso.uiuc.edu Newsgroups: comp.text Subject: Re: Test--please ignore Message-ID: <47700011@uxe.cso.uiuc.edu> Date: 6 Apr 88 21:20:00 GMT References: <47700010@uxe.cso.uiuc.edu> Lines: 21 Nf-ID: #R:uxe.cso.uiuc.edu:47700010:uxe.cso.uiuc.edu:47700011:000:819 Nf-From: uxe.cso.uiuc.edu!ceblair Apr 6 15:20:00 1988 % I am trying to do the following in TeX: I have a sequence of % groups of small letters, with one space between each group, followed % by a Z at the end. Each group has at least two letters. I want to % put a number in front of each group. % The macro below works, in the sense that when I run it, I get % 1 ab 2 cde 3 fed 4 qrs 5 dd etc., % but it must be terribly inefficient. If I try it with even a few % more groups than shown here, I get "Memory Capacity Exceeded" % messages related to parameter stack size. Comments welcome. % Charles Blair [BITNET: CEBLAIR at UIUCVMD] \def\numb#1Z{\count11=1 \num#1 W Z} \def\num#1#2 #3Z{\if #1W {} \else {\number\count11} #1#2 \advance% \count11 by 1\num #3Z\fi} \numb ab cde fed qrs dd dede fghjk klkvds mbcd abcde fg hj Z \bye