[comp.text.tex] a small question: beautify TeX code

xiaofei@EINSTEIN.PHYSICS.BUFFALO.EDU (05/16/91)

TeX doesn't do what I want:
 
\font\cs=cmr12 \cs
 
a paragraph % I want a regular parskip
 
\parindent=8 mm \parskip= 0 mm
% I don't want a regular parskip
\item{[1]} a
\item{[2]} short
\item{[3]} list
% I want go back to regular parskip
\parindent=0mm \parskip=3pt plus1pt minus .5pt
 
another paragraph
\end
 
I have to do:
 
\font\cs=cmr12 \cs
 
a paragraph % I want a regular parskip
 
\parindent=8 mm
% I don't want a regular parskip
\item{[1]} a      \parskip= 0 mm % I have to put \parskip=0mm here :-(
\item{[2]} short
\item{[3]} list
% I want go back to regular parskip
\parindent=0mm \parskip=3pt plus1pt minus .5pt
 
another paragraph
\end
 
Above code works but looks ugly. Can someone suggest me a better code?
Thanks.

BNB@MATH.AMS.COM (bbeeton) (05/16/91)

you can get what you want by using grouping, either with braces, or
with \begingroup ... \endgroup .  here's how i'd go about it:
 
\font\cs=cmr12 \cs
 
a paragraph % I want a regular parskip
 
\begingroup
\parindent=8 mm \parskip= 0 mm
% I don't want a regular parskip
\item{[1]} a
\item{[2]} short
\item{[3]} list
% I want go back to regular parskip
\par
\endgroup
 
another paragraph
\end
 
now, this does have some problems at the junctures at begin and end
of the group.  the \parindent value used is what is in effect when
a paragraph ends.  the \parskip value used is what's in effect when
a paragraph begins.  (at least, i think that's it; i always have to
experiment, but that's usually not a real problem.)  so i'd modify
the above just a bit:
 
\font\cs=cmr12 \cs
 
a paragraph % I want a regular parskip
 
\begingroup
\parindent=8 mm
% I want to change the paragraph indent
\item{[1]} a
\parskip= 0 mm
% I don't want a regular parskip
\item{[2]} short
\item{[3]} list
% I want go back to regular parskip and parindent
\par
\endgroup
 
another paragraph
\end
 
this should work, and you don't have to remember what your "regular"
values were.
                                                -- bb
-------