Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!bionet!uwm.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!s41.csrd.uiuc.edu!eijkhout From: eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) Newsgroups: comp.text.tex Subject: Re: Writing a macro with variable number of parameters... Message-ID: <1990Dec13.205013.22645@csrd.uiuc.edu> Date: 13 Dec 90 20:50:13 GMT References: <1236@happy.osc.edu> Sender: news@csrd.uiuc.edu (news) Distribution: usa Organization: UIUC Center for Supercomputing Research and Development Lines: 23 spencer@cgrg.ohio-state.edu (Stephen N. Spencer) writes: >Is there a way to write a macro which can have a variable number of >parameters to it? I understand that there can be up to nine parameters >(from the TeXbook) but the macro, as I plan to write it, will have a maximum >of eight parameters and a minimum of two parameters. >I have looked at 'latex.tex', thinking that '\documentstyle[]{}' has an >optional parameter, but that's only one parameter, not multiple. >Has anyone come up with something like this? Thanks for the help and advice. Well, \documentstyle does look like it has an optional parameter, so what's the difference with actually having one? I would take me more than a few lines to sketch how to implement optional parameters, but you may find a very instructive article on this subject in TUGboat vol9 nr3, Stephan von Bechtolsheim's `tutorial on \futurelet' explains this all quite well. Victor.