[comp.text] Centred tabbing environment

sf352@citycs.uucp (Paul Abraham) (11/22/89)

How do you centre a tabbing environment?

I've tried minipage and parbox, but all to no avail.

I have also RTFM.

Paul Abraham.                    sf352@city.{ac.uk,uucp}

dhosek@jarthur.Claremont.EDU (D.A. Hosek) (11/27/89)

In article <1989Nov22.113043.21298@cs.city.ac.uk> sf352@city.ac.uk (Paul Abraham) writes:
>How do you centre a tabbing environment?

>I've tried minipage and parbox, but all to no avail.

>I have also RTFM.

OK, the manual says that if a tabbing environment is placed in a minipage
whose specified width is wider than the tabbing environment, the width
of the minipage will be the width of the tabbing (or similarly confusing 
words to that effect). Leslie _should_ have given an example. _My_ book 
which should be out next summer does (blatant plug), and it looks 
something like this:

\begin{center}
\begin{minipage}{\textwidth}
\begin{tabbing}
  ---
  Some tabbing crud goes here
  ---
\end{tabbing}
\end{minipage}
\end{center}

By specifying \textwidth as the width of the minipage, the specified 
width of a page is the width of a full line of text. Thus, if \textwidth
is, say, 4in and the tabbing environment is 3in wide, the minipage
will have a width of 3in. If the tabbing environment is 5in wide, the
minipage will have a width of 4in. The center environment will take
the tabbing environment in the above example and center it if it is
narrower than the width of the text, otherwise, it will be set
flush left.

Now, if the tabbing environment is _wider_ than \textwidth, you have
a problem. If you experiment a bit, you will find that LaTeX 
normally _never_ centers anything wider than the width of a line
of text (there are technical reasons why the center environment does
not work like plain TeX's \centerline command). If you really
want to be able to have centered items wider than \textwidth
centered, you will need to do something like the following:
\makeatletter
\setlength{\@flushglue}{0pt plus \fill minus 1in}
\makeatother

\@flushglue is a rubber space inserted on each side of the text in
the center environment (it is also used in the flushleft and 
flushright environments). The above example allows items in the 
center environment to stick into each margin by as much as one inch.
Anything wider than that should probably be presented in a different
manner. Also, for technical reasons, the "minus" part of the 
\@flushglue length cannot be \fill

-dh
-- 
"Odi et amo, quare id faciam, fortasse requiris?
   nescio, sed fieri sentio et excrucior"          -Catullus
D.A. Hosek.                        UUCP: uunet!jarthur!dhosek
                               Internet: dhosek@hmcvax.claremont.edu