Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!jarthur!nntp-server.caltech.edu!news From: marcel@cs.caltech.edu (Marcel van der Goot) Newsgroups: comp.text.tex Subject: Re: how to make "_" non-special? Summary: make it active Keywords: \active, \_, underscore, subscript Message-ID: <1991Jan16.220735.17896@nntp-server.caltech.edu> Date: 16 Jan 91 22:07:35 GMT References: <8763@star.cs.vu.nl> Sender: news@nntp-server.caltech.edu Organization: California Institute of Technology (CS dept) Lines: 39 Nntp-Posting-Host: stun4i.caltech.edu In <8763@star.cs.vu.nl> Fred Douglis (douglis@cs.vu.nl) asks > Can anyone tell me what magic might be necessary to redefine "_" to > have its normal meaning? If you always want to use an _ as just an _, you can say \catcode`\_=13 \let_=\_ (actually, the second line is not necessary, it is already done in plain.tex --- not documented in the TeXbook) If you also want to write subscripts now and then, you can make " into a subscript character by saying \catcode`\"=13 Then you can write $x"0$. It disables other usage of " though. A slightly more sophisticated solution is to forget the above and instead write \catcode`\_=13 {\catcode`*=8 \gdef_{\ifmmode\let\next=*\else\let\next=\_\fi\next} } This makes _ into a normal underscore when used in normal text, but when you use it in mathmode it is still the underscore character. So you can write some_identifier $= x_0$ but not $$some_identifier = x_0$$ Which solution is most suitable depends on your application. Marcel van der Goot marcel@vlsi.cs.caltech.edu