Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uwm.edu!linac!midway!ux1.cso.uiuc.edu!csrd.uiuc.edu!s41.csrd.uiuc.edu!eijkhout From: eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) Newsgroups: comp.text.tex Subject: Re: how to make "_" non-special? Message-ID: <1991Jan16.223500.18314@csrd.uiuc.edu> Date: 16 Jan 91 22:35:00 GMT References: <8763@star.cs.vu.nl> Sender: news@csrd.uiuc.edu (news) Organization: UIUC Center for Supercomputing Research and Development Lines: 23 douglis@cs.vu.nl (Fred Douglis) writes: >I'm editing a document that includes a fair number of underscores. If I >include "foo_bar" then LaTeX complains that I left out the $ for math >mode. But "foo\_bar" gets awfully monotonous. Can anyone tell me what >magic might be necessary to redefine "_" to have its normal meaning? >(A "normal_underscore.sty" file would be ideal. :-) In fact you don't want to make _ nonspecial (really you don't, let me convince you), but special in another way. \catcode`\_=12 makes the underscore normal. Try it, and see that it doesn't do what you want, unless you're in typewriter mode. Reason is that there is no underscore in TeX's roman font. \catcode`\_=13 \def_{\_} will do what you want: the underscore now becomes by itself a macro that xpands in to the \_ command. And now you're in trouble if you wnat to do mathematics, so: \everymath{\catcode`\_=8 } \everydisplay=\everymath Victor.