Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!ox-prg!culhua!jg From: jg@prg.ox.ac.uk (Jeremy Gibbons) Newsgroups: comp.text.tex Subject: Re: easy macro for novice Message-ID: Date: 7 Dec 90 16:33:36 GMT References: Sender: news@prg.ox.ac.uk Distribution: comp Organization: Oxford University Computing Laboratory, UK Lines: 31 In-reply-to: davis@pacific.mps.ohio-state.edu's message of 5 Dec 90 07:28:59 GMT davis@pacific.mps.ohio-state.edu ("John E. Davis") writes > I wrote the following macro: > \def\dolines#1{\medskip\obeylines#1\medskip} [...] > This is not what I want. Aparantly TeX is converting the 'newlines' to > spaces before substitution into the macro. If this is the correct > diagnosis, how do I supress this within the macro definition? Your diagnosis is nearly correct. \obeylines `changes the category codes' of newlines, to make them `active' (ie TeX commands); newline is then defined to do a \par. Unfortunately, the category codes of arguments to macros are fixed when the argument is matched, not when it is executed, so the newlines in your argument aren't active ones. The easiest fix is not to pass the text as an argument: \def\dolines{\medskip\obeylines} \def\enddolines{\medskip} \begin{dolines} Line 1. Line 2. Line 3. \end{dolines} (At a guess.) *-----------------------------------------------------------------------* | Jeremy Gibbons (jg@uk.ac.oxford.prg) Funky Monkey Multimedia Corp | *-----------------------------------------------------------------------*