Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!cs.ed.ac.uk!ajcd From: ajcd@cs.ed.ac.uk (Angus Duggan) Newsgroups: comp.text.tex Subject: defining active characters by number Keywords: active characters Message-ID: <157@skye.cs.ed.ac.uk> Date: 10 Aug 90 19:50:33 GMT Sender: nnews@cs.ed.ac.uk Reply-To: ajcd@cs.ed.ac.uk (Angus Duggan) Followup-To: comp.text.tex Organization: Edinburgh University Fried Brain Carry-out Lines: 28 I'm flummoxed. I've searched through the TeXbook for an answer to this problem, and tried everything I can think of, but I can't find an answer. I want to make a character active, and define a macro for it, with only the number of the character specified (in a count register). What I'm trying to do is to set up a lot of the character codes from 128--255 to call a common macro, with the number of the character code as a parameter. I'd prefer to have a loop, something like: \bgroup % localise \count0 \count0=161 \loop \expandafter\global\expandafter\catcode\count0=\active % \edef active character number \count0 to expand to: % {\noexpand\macro{\the\count0}} \advance\count0 by 1 \ifnum\count0<255\repeat \egroup The only way I can see of doing this is writing out an auxiliary file, and re-reading it. Somebody please show me that I'm wrong. A. == Angus Duggan, Department of Computer Science, | Ignorance of the manual is University of Edinburgh, JCMB, | no excuse. The King's Buildings, Mayfield Road, | JANET: ajcd@uk.ac.ed.lfcs Edinburgh, EH9 3JZ, Scotland. | OR: ajcd%lfcs.ed.ac.uk@nsfnet-relay.ac.uk