[texhax] too much space

Fehd, Ronald J. (CDC/CCHIS/NCPHI) rjf2 at CDC.GOV
Tue May 8 22:46:07 CEST 2007


> From: "Randy Schilling" <RChilling at comcast.net>

 > I'm having a problem with macros that contain a lot of code, 
 > conditionals, loops, some recursion, 
 > manipulation of count registers and so on. 
 > The product of such macros, that which is to be typeset, 
 > often contains unexpected space to the left and / or right. 
 > Eliminating this space is my problem. 
 > I can see no pattern to the amount of such space, 
 > if I could I probably wouldn't need to be writing. 
 > The amount of this space 
 > is usually reduced by tightening up on the code, 
 > by that I mean removing gaps in the code 
 > (gaps that most macros I would to leave 
 > just to maintain readability, 
 > something important for my failing memory). 
 > This reduces code to one long line, 
 > gaps only at points where, well, 
 > without them there is no output or the output is incorrect. 
 > One example of such a necessary gap 
 > is between the definition of a count register and an \if. 
 > Like I said, this helps 
 > but it does not eliminate the unexpected space. 
 > I wonder if anyone out there has had experience 
 > with this problem; 
 > if so I would be very grateful for a hint on how to deal with it. 
 > In any case, thanks very much and have a great day.

%
obviously your post was formated to show your problem.
%
I have experienced a similar problem when writing TeX/LaTeX macros.
%
My fix was to eliminate all blank lines
%
either remove them or put a comment (%) in column 1
as I have done here.
%
You also want to carefully check %
that there are %
or are not appropriate spaces at end of each line.%
%
I hope this reply is not word-wrapped %
since it illustrates my solution.

Ron Fehd  the {SAS} macro maven  CDC Atlanta GA USA RJF2 at cdc dot gov




More information about the texhax mailing list