Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!edcastle!cs.ed.ac.uk!jcb From: jcb@cs.ed.ac.uk (Julian Bradfield) Newsgroups: comp.text.tex Subject: Re: Explanation requested re: \uppercase and \romannumeral Message-ID: <5310@skye.cs.ed.ac.uk> Date: 31 Jan 91 16:49:00 GMT References: Sender: nnews@cs.ed.ac.uk Reply-To: jcb@lfcs.ed.ac.uk (Julian Bradfield) Organization: Laboratory for the Foundations of Computer Science, Edinburgh U Lines: 18 In article brister@decwrl.dec.com (James Brister) writes: > 1) \uppercase{\romannumeral\count0} > 2) \uppercase\expandafter{\romannumeral\count0} >Why, in the first example, doesn't the '\romannumeral\count0' get expanded >to the token string, before \uppercase sees it. >I think this is due the 'stomach' vs. 'mouth' business of TeX (a concept >I'm not too clear on yet). True? No, it's all happening in the mouth. In line 1, \uppercase wants a token list, and expansion is switched off when reading this list (it's one of the cases listed in Chap. 20). In line 2, the \expandafter forces expansion of \romannumeral ; the expansion is put back after the {, and then the token list for \uppercase is read as normal, without expansion. (Expansion is switched off when TeX sees the left brace starting the token list.)