Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!hubcap!gatech!prism!ne201ph From: ne201ph@prism.gatech.EDU (Halvorson,Peter J) Newsgroups: comp.text.tex Subject: Re: Help on LaTeX hacking. Message-ID: <20428@hydra.gatech.EDU> Date: 26 Jan 91 18:56:46 GMT References: <20376@hydra.gatech.EDU> Organization: Georgia Institute of Technology Lines: 42 In article <20376@hydra.gatech.EDU> I write: >I hope someone can help me with this problem. > >I'm writing a technical paper and make frequent reference to leidenfrost >temperature. I have abbreviated this with: > >\newcommand{\tleid}{$ T_{Leid}$} > >Now I can just put \tleid in normal text. The first problem is that this >will ignore a normal space after \tleid. If I put a hard space in the >definition, it wouldn't work if followed by a punctuation mark. The second >problem is that I would like to be able to use the same command if I'm >already in the math mode ( although I could live with \tleidm or something >similar). > >Is the answer obvious to anyone? > >Thanks > The answer was obvious to at least 5 people so far, raymond@math.berkeley.edu (Raymond Chen), guy@phy.duke.edu (Guy Metcalfe), Kresten Krab Thorup , Laszlo C. Balint , and allbery@NCoast.ORG (Brandon S. Allbery KB8JRR). TeX will not treat a command as an ordinary word, I can stick {} after each use, or a \ if I really want a space after. I can write it to detect math mode like this: \newcommand{\tleid}{\ifmmode T_{Leid}\else$ T_{Leid}$\fi} Thanks. -- Peter Halvorson -- Nuclear Engineering Program Georgia Institute of Technology, Atlanta Georgia, 30332 uucp: ...!{allegra,amd,hplabs,ut-ngp}!gatech!prism!ne201ph Internet: ne201ph@prism.gatech.edu -- peter@fission.gatech.edu