[OS X TeX] Off Topic: changing command behavior (legacy issue)

Francesco Costanzo costanzo at engr.psu.edu
Wed Sep 1 15:54:15 EDT 2004


Hi There:

I have a question concerning how to modify the behavior of a command I 
have defined in a document I have written.

*PREMISE*
Currently, I have a command that works as follows:

\mycommand[option]{FirstArgument}{SecondArgument}

where `SecondArgument' is a string that gets used as the argument of a 
\label command.

*WHAT I WANT*
I would like to modify the behavior of \mycommand so that the following 
two forms result in the same outcome:

form 1: \mycommand[option]{FirstArgument}{SecondArgument}

form 2: \mycommand[option]{FirstArgument}{\label{SecondArgument}}

In other words, if `SecondArgument' is a string then behave as usual; 
if instead the second argument is already in the form 
`\label{SecondArgument}' then use as is (as opposed to doing 
\label{\label{SecondArgument}}).

In case you are wondering as why I would want to do something like 
this, let me just say that the problem concerns a book in two volumes 
managed by various authors and some of them wish to use one form and 
the command while others wish to use the other one (not to mention the 
fact that there are about 1000 pages already written which I'd rather 
not modify).

-- 
Francesco Costanzo
Associate Professor

Engineering  Science and  Mechanics  Department
The Pennsylvania State University
212 Earth and Engineering Sciences Bldg.
University Park, PA 16802-1401
USA

Phone:   (814)863-2030
Fax:     (814)863-7967
mailto:costanzo at engr.psu.edu
http://www.esm.psu.edu/HTMLs/Faculty/FCostanzo.html

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list