[texhax] spaces at beginning of environment

Carlos Oliveira coliveira at gmail.com
Tue Dec 28 19:00:10 CET 2004


I wrote a simple macro for algorithms, that I use as

\begin{tabbing}
\begalg
% algorithm here
\end{tabbing}

To improve this, I defined the following:

\newenvironment{algenv}{\begin{tabbing}\begalg}{\end{tabbing}}

But now there is a space before the first line of the algorithm when I use

\begin{algenv}
%algorithm
\end{algenv}

Can you see what is generating this space, and how can I remove it?

Regards,
-Carlos

The rest of the macros are bellow, if you need to check it;

---------------------
\def\ntab#1{\ifcase#1\relax\or\>\or\>\>\or\>\>\>\or\>\>\>\>\or%
\>\>\>\>\>\or\>\>\>\>\>\>\or\>\>\>\>\>\>\>\or\>\>\>\>\>\>\>\>\fi}
\newcount\indentnum \newcount\alglinenum
\def\printlnum{{\footnotesize\oldstylenums{\number\alglinenum}}}
\def\begalg{\global\alglinenum=0\qquad\=\quad\=\quad\=\quad\=\quad\=\kill%
   \global\indentnum=0 %
   \global\advance\alglinenum by1 \printlnum\>\ntab\indentnum}
\def\br{\\\global\advance\alglinenum by1 \printlnum\>\ntab\indentnum}
\def\brp{\global\advance\indentnum by1\br} 
\def\brl{\global\advance\indentnum by-1\br}
\def\For{{\bf for}\ }
\def\While{{\bf while}\ }

---------------------

-- 
Carlos Oliveira
Ind. Engineering and Mgmt
322 Engineering North, OK State University
Stillwater OK, 74078



More information about the texhax mailing list