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

  1. Path: sparky!uunet!mcsun!uknet!mucs!m1!carlisle
  2. From: carlisle@cs.man.ac.uk (David Carlisle)
  3. Newsgroups: comp.text.tex
  4. Subject: Re: Delimiters
  5. Message-ID: <CARLISLE.92Aug26173813@r8d.cs.man.ac.uk>
  6. Date: 26 Aug 92 16:38:13 GMT
  7. References: <1992Aug26.130422.7351@EE.Surrey.Ac.UK>
  8. Sender: news@cs.man.ac.uk
  9. Organization: Department of Computer Science, University of Manchester
  10. Lines: 44
  11. In-reply-to: J.Deane@ee.surrey.ac.uk's message of 26 Aug 92 13:04:22 GMT
  12.  
  13.  
  14. >>>>> On 26 Aug 92 13:04:22 GMT, J.Deane@ee.surrey.ac.uk (Jonathan Deane) said:
  15. ...
  16. Jonathan> \def\sciamref#1#2
  17. Jonathan> % #1 is the date, #2 the page number
  18. Jonathan>     {({\em Sci.\ Am.}\enspace#1, p.\hskip2pt#2)}
  19. ...
  20. Jonathan> What is going wrong?
  21.  
  22. \def\foo#1#2
  23.    {xxx}
  24. is equivalent to 
  25. \def\foo#1#2 {xxx}
  26.  
  27. This makes #2 a delimited argument, and in this case #2 is
  28. everything up until the next space token.
  29.  
  30. One solution is just to go
  31.  
  32. \def\sciamref#1#2% < this % is needed if you want to break the line here 
  33. % #1 is the date, #2 the page number
  34.     {({\em Sci.\ Am.}\enspace#1, p.\hskip2pt#2)}
  35.  
  36. Note that Lamport does not tell you about delimited arguments, but he
  37. also tells you not to use \def !
  38.  
  39. So a better solution to your problem is to go:
  40.  
  41. \newcommand{\sciamref}[2]
  42.     {({\em Sci.\ Am.}\enspace#1, p.\hskip2pt#2)}
  43.  
  44. It takes a few more keystokes, but it keeps LaTeX purists like myself happy  
  45.  
  46. David
  47. --
  48.                            David Carlisle
  49.                                     JANET: carlisle@uk.ac.man.cs
  50.  
  51.                                     Computer Science Department
  52.                                     Manchester University
  53.                                     Oxford Road
  54.                                     Manchester
  55.                                     England
  56.                                     M13 9PL
  57.