summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/base/source/ctabbing.sty
blob: acc4c9c8df015cc6118647003df267f412579978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
% $Id: ctabbing.sty,v 1.2 2004/09/19 19:10:08 karl Exp $
% Public domain.
% 
% The ctabbing environment is a centered tabbing environment suitable for
% displaying program fragments.  The vertical spacing is exactly like that
% for normal text in a center environment.  This is achieved by setting
% \@minipagetrue to fool \tabbing into thinking that it starts a minipage
% and should therefore avoid all vertical space at the top.  (Note that any
% space at all would defeat the \vtop command in \ctabbing.)  The
% \vskip-\lastskip and \prevdepth saving commands avoid extra space after
% \endtabbing

\newdimen\ct@pd

\def\ctabbing{\center\leavevmode\vtop\bgroup\@minipagetrue\begingroup\tabbing}

\def\endctabbing{\endtabbing\endgroup\vskip-\lastskip
                \global\ct@pd\prevdepth \egroup
                \endcenter \global\prevdepth\ct@pd}