Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!bbn.com!hersh From: hersh@bbn.com (Hershel Safer) Newsgroups: comp.text.tex,bbn.tex Subject: Labels that store the kind of object being labeled Keywords: labels Message-ID: <63335@bbn.BBN.COM> Date: 20 Mar 91 15:48:51 GMT Sender: news@bbn.com Reply-To: hersh@BBN.COM () Followup-To: comp.text.tex Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 47 Rather than write Theorem~\ref{foo} all the time, I use \newcommand{\thmref}[1]{Theorem~\ref{#1}} . Actually, it's fancier; since I may want the same label for a theorem, an associated figure, and the section in which they are found, I have \newcommand{\thmref}[1]{Theorem~\ref{th:#1}} , \newcommand{\secref}[1]{Section~\ref{s:#1}} , and a variety of other referencing commands with different prefixes. I also have corresponding labeling commands, such as \newcommand{\thmlabel}[1]{\label{th:#1}} and \newcommand{\seclabel}[1]{\label{s:#1}} . Here's the problem. Suppose that I change a theorem to a proposition. Changing \thmlabel to \proplabel is easy enough, but then I also have to change all references to the claim from \thmref to \propref. What I would like is a single labeling command and a single referencing command. The labeling command would take two arguments; the first would be the _kind_ of item and the second would be the label. It would store the kind of item. The referencing command would take a single argument, the label. It would use the stored item information to prepend the correct word to the reference number. Any references to existing solutions or suggestions for how to do this? Either TeX or LaTeX would be fine. Thank you. -- Hershel Safer +------------------------------------------------------------------+ | BBN Communications +1 (617) 873-2508 (voice) | | Bolt Beranek and Newman Inc. 873-8202 (fax) | | 150 Cambridge Park Drive, MS 20/6B | | Cambridge, MA 02140, USA Internet: hersh@bbn.com | +------------------------------------------------------------------+ -- Hershel