Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!umich!vela!rjohnson From: rjohnson@vela.acs.oakland.edu (R o d Johnson) Newsgroups: comp.text.tex Subject: Testing for null arguments Keywords: latex Message-ID: <5396@vela.acs.oakland.edu> Date: 13 Mar 91 22:09:32 GMT Organization: Storefront Witchdoctors Lines: 35 This is undoubtedly a question with a simple answer that I just can't seem to get. I want to have a macro (for use in LaTeX documents) that can have three arguments, two of which can be null. It's invoked like this: \prt{arg1}{arg2}{arg3} but could also look like any of the following: \prt{}{arg2}{arg3} \prt{arg1}{arg2}{} \prt{}{arg2}{} (arg2 will always be present). I want to define an new \if (I guess) that would allow me to define a macro like the following: \def\part#1#2#3{% % or should there be braces around [some code] % the arguments in the definition? % \ifnull{#1} \relax \else % I guess it would be simpler to have [some more code] % an \ifnotnull to do this \fi % \ifnull{#3} \relax \else [some more code] \fi } I just can't figure out how to come up with an \ifnull or \ifnotnull. Any suggestions? Thanks in advance. -- Rod Johnson * rjohnson@vela.acs.oakland.edu * (313) 650 2315 "Life has a throat" --Peter Blegvad