home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / text / tex / 10655 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!gateway
  2. From: iwsbarke@acs.ucalgary.ca (Scott Barker)
  3. Newsgroups: comp.text.tex
  4. Subject: need help with a LaTeX macro
  5. Date: 28 Aug 1992 16:45:44 -0500
  6. Organization: UTexas Mail-to-News Gateway
  7. Lines: 38
  8. Sender: daemon@cs.utexas.edu
  9. Message-ID: <9208282143.AA24890@acs1.acs.ucalgary.ca>
  10. NNTP-Posting-Host: cs.utexas.edu
  11.  
  12. Sorry if this shows up more than once - it didn't seem to work the first time
  13. ------------------------------------------------------------------------------
  14.  
  15. Hi, I'm having problems with a macro, and I was wondering if anyone could
  16. help. I started with a command:
  17.  
  18. \verb"some text"\\
  19.  
  20. Which I wanted to change into a macro:
  21.  
  22. \type{some text}
  23.  
  24. So I defined the macro as:
  25.  
  26. \newcommand{\type}[1]{\verb"#1"\\}
  27.  
  28. Which works fine, except when {some text} contains special characters such as
  29. #$_ etc. Now, when I do:
  30.  
  31. \verb"# comment line for some programming language"\\
  32.  
  33. There is no problem, but when I use my macro:
  34.  
  35. \type{# comment line for some programming language}
  36.  
  37. LaTeX complains (actually, I think it is TeX complaining) about improper use
  38. of the # character.
  39.  
  40. Any ideas why the command works, but the macro doesn't?
  41.  
  42. Thanks for any help you can give.
  43.  
  44. --
  45. Scott Barker
  46. barker@enel.ucalgary.ca
  47.  
  48. "Logic is the beginning of wisdom, not the end."
  49.    - Spock, Star Trek VI: The Undiscovered Country
  50.