home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / text / tex / 14631 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.1 KB  |  38 lines

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!news.univie.ac.at!vm.univie.ac.at!A8131DAL
  3. From: A8131DAL@vm.univie.ac.at (Peter Schmitt)
  4. Subject: Re: Disabling the underscore character
  5. Message-ID: <1993Jan5.185108.4040@newssrv.edvz.univie.ac.at>
  6. Sender: news@newssrv.edvz.univie.ac.at (News System - Vienna University)
  7. Nntp-Posting-Host: helios.edvz.univie.ac.at
  8. Organization: University of Vienna
  9. Date: Tue, 5 Jan 1993 18:43:24 GMT
  10. Lines: 26
  11.  
  12. >file name as part of what it does.  The macro does not
  13. >work if the file name has an underscore character in it,
  14. >since it interprets the underscore as the subscript
  15. >character and starts inserting $ signs.
  16.  
  17. >\def\foo#1{ {\tt #1} }
  18. >\foo{file_name.ext}
  19.  
  20. >I tried defining foo as follows:
  21.  
  22. >\def\foo#1{ {\catcode`_=12 {\tt #1} } }
  23.  
  24. This is a very common error: The catcode is already fixed when the
  25. argument is passed!
  26.  
  27. >{\catcode`_=12 \foo{file_name.ext} }
  28.  
  29. >Is there a way of avoiding this and doing everything
  30. >inside the macro?
  31.  
  32. Sure: Use a macro to call \foo:
  33. e.g.: \def \Foo{\bgroup\catcode`\_=12\foo}
  34. and add a \egroup to the end of \foo
  35.  
  36. Peter
  37.  
  38.