Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!stanford.edu!neon.Stanford.EDU!ibis.Stanford.EDU!espie From: espie@ibis.Stanford.EDU (Marc Espie) Newsgroups: comp.text.tex Subject: Re: Math mode in LaTeX Message-ID: <1991May28.070140.16324@neon.Stanford.EDU> Date: 28 May 91 07:01:40 GMT References: <1991May15.205919.12393@serval.net.wsu.edu> Sender: news@neon.Stanford.EDU (USENET News System) Organization: LIENS, ENS, 45 rue d'Ulm, Paris (France) Lines: 32 In article jefft@athena.mit.edu (Jeff Tang) writes: >In article <1991May15.205919.12393@serval.net.wsu.edu> rdubey@yoda.eecs.wsu.edu (Rakesh Dubey - grad student) writes: > > I need to typeset a lot of material in which mathematical > formulas are interspersed with text. Is it possible to define > something similar to $...$ for the text mode, so that I could use it > instead of \mbox{...} which really gets clumsy and takes too much > space. Right now I write $a \mbox{ or } b$ where it will be very > nice to have something like $a !or! b$. I believe formulas will be > easier to read this way. (The letter ! is just for example). > >How about the $ character? > >$a$ or $b$ should work, though you'll probably need to add spaces. > >Jeff Tang >jefft@athena.mit.edu There is a very good reason why this is not a good idea: $\left(a ! or ! b \right)$. and another one: $$a ! or ! b$$ So, now redefining !thing! to act like \mbox{thing} is not really difficult. Here is a quick answer, it should work with little or no modification. ---- \catcode`\!=\active \def\leavemath{\egroup\let!=\entermath} \def\entermath{\let!=\leavemath\mbox\bgroup} \let!=\leavemath ---- Marc (espie@flamingo.stanford.edu)