home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.text.tex
- Path: sparky!uunet!news.univie.ac.at!vm.univie.ac.at!A8131DAL
- From: A8131DAL@vm.univie.ac.at (Peter Schmitt)
- Subject: Re: Disabling the underscore character
- Message-ID: <1993Jan5.185108.4040@newssrv.edvz.univie.ac.at>
- Sender: news@newssrv.edvz.univie.ac.at (News System - Vienna University)
- Nntp-Posting-Host: helios.edvz.univie.ac.at
- Organization: University of Vienna
- Date: Tue, 5 Jan 1993 18:43:24 GMT
- Lines: 26
-
- >file name as part of what it does. The macro does not
- >work if the file name has an underscore character in it,
- >since it interprets the underscore as the subscript
- >character and starts inserting $ signs.
-
- >\def\foo#1{ {\tt #1} }
- >\foo{file_name.ext}
-
- >I tried defining foo as follows:
-
- >\def\foo#1{ {\catcode`_=12 {\tt #1} } }
-
- This is a very common error: The catcode is already fixed when the
- argument is passed!
-
- >{\catcode`_=12 \foo{file_name.ext} }
-
- >Is there a way of avoiding this and doing everything
- >inside the macro?
-
- Sure: Use a macro to call \foo:
- e.g.: \def \Foo{\bgroup\catcode`\_=12\foo}
- and add a \egroup to the end of \foo
-
- Peter
-
-