home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!mucs!m1!carlisle
- From: carlisle@cs.man.ac.uk (David Carlisle)
- Newsgroups: comp.text.tex
- Subject: Re: Delimiters
- Message-ID: <CARLISLE.92Aug26173813@r8d.cs.man.ac.uk>
- Date: 26 Aug 92 16:38:13 GMT
- References: <1992Aug26.130422.7351@EE.Surrey.Ac.UK>
- Sender: news@cs.man.ac.uk
- Organization: Department of Computer Science, University of Manchester
- Lines: 44
- In-reply-to: J.Deane@ee.surrey.ac.uk's message of 26 Aug 92 13:04:22 GMT
-
-
- >>>>> On 26 Aug 92 13:04:22 GMT, J.Deane@ee.surrey.ac.uk (Jonathan Deane) said:
- ...
- Jonathan> \def\sciamref#1#2
- Jonathan> % #1 is the date, #2 the page number
- Jonathan> {({\em Sci.\ Am.}\enspace#1, p.\hskip2pt#2)}
- ...
- Jonathan> What is going wrong?
-
- \def\foo#1#2
- {xxx}
- is equivalent to
- \def\foo#1#2 {xxx}
-
- This makes #2 a delimited argument, and in this case #2 is
- everything up until the next space token.
-
- One solution is just to go
-
- \def\sciamref#1#2% < this % is needed if you want to break the line here
- % #1 is the date, #2 the page number
- {({\em Sci.\ Am.}\enspace#1, p.\hskip2pt#2)}
-
- Note that Lamport does not tell you about delimited arguments, but he
- also tells you not to use \def !
-
- So a better solution to your problem is to go:
-
- \newcommand{\sciamref}[2]
- {({\em Sci.\ Am.}\enspace#1, p.\hskip2pt#2)}
-
- It takes a few more keystokes, but it keeps LaTeX purists like myself happy
-
- David
- --
- David Carlisle
- JANET: carlisle@uk.ac.man.cs
-
- Computer Science Department
- Manchester University
- Oxford Road
- Manchester
- England
- M13 9PL
-