Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!sdd.hp.com!hplabs!hpcc05!hpcc01!gampell From: gampell@hpcc01.HP.COM (David J. Gampell) Newsgroups: comp.text.tex Subject: Re: LaTeX: figure placement and centering Message-ID: <2320003@hpcc01.HP.COM> Date: 26 Oct 90 20:57:43 GMT References: <457@scubed.SCUBED.COM> Organization: the Packard Saw Mill, Twin Peaks, WA Lines: 104 / hpcc01:comp.text.tex / rankin@s3snorkel.ARPA (Tom Rankin) / 2:39 pm Oct 24, 1990 / >I've exhausted all of my patience and resources trying to solve these >problems. With any luck, someone here can offer salvation. > >I am using: > TeX, C Version 2.93 > LaTeX Version 2.09 - Released 19 April 1986 > >My source is written using the report style, however, changing to the >book style didn't seem to effect any of my results in the least. I >haven't tried the article style since I'm using \chapter sectioning >(and article.sty doesn't have \chapter). > >Here are my problems: > > 1. Location of figures. > > I'm attempting to specify that I would like my figures to appear > "here", as in *right* *here*!, using the following construct: > > \begin{figure}[h] > [...contents of figure...] \end{figure} > > The figures are consistently coming up at the *end* of my > document, not in-line as desired (and as advertised by the "here" > location specifier). Very frustrating. How do I have to hold my > mouth to get this to work? You don't have enough location specifiers to get this to work. LaTeX requires that there be enough location specifiers (default tbp) to place the figure *somewhere*. If, for example, there isn't enough room on the page for your figure when LaTeX encounters \begin{figure}[h], it will place your figure at the end of the current chapter (or when the next \clearpage, \cleardoublepage or \end{document}) is encountered. Try \begin{figure}[htbp], which should have a much higher likelihood of placing your figures correctly. > 2. Centering the tabbing environment within a figure. > > I'm trying to center a \tabbing environment using either of the > following constructs: > > \begin{figure}[h] > \centering > \begin{tabbing} > [...tabbing stuff...] > \begin{tabbing} ^^^^^ Presumably you mean \end{tabbing} > \end{figure} > > OR > > \begin{figure}[h] > \begin{center} > \begin{tabbing} > [...tabbing stuff...] > \end{tabbing} > \end{center} > \end{figure} > > The result is the same in both cases, the material withing the tabbing > environment ends up left justified. > > I do have a couple of figures that use the tabular environment and > they center properly using the same two techniques. Although I could > probably use the tabular environment in place of the tabbing one I'm > using, it would be a misuse of the tabular environment (the tabbing > environment, on the other hand, serves my purpose *exactly* -- except > I can't get the damn thing centered on the page). You have what I think is a mode clash. The figure environment want to process stuff in paragraph mode while the tabbing environment processes stuff in LR mode. To accomplish what you want, try this... \begin{figure}[htbp] \begin{minipage}{\textwidth} \centering \begin{tabbing} . . . \end{tabbing} \end{minipage} \caption{if any} \label{if-any} \end{figure} The minipage environment forces whatever's inside it to be processed in paragraph mode. This should allow the \centering command to work. Sorry, I don't know anything about \samepage. >Tom Rankin >rankin@scubed.scubed.com >-------------------------------------------------------------------------- >Tom Rankin Maxwell Laboratories, S-CUBED Division 3398 Carmel Mtn Rd. >rankin@scubed.scubed.com (619) 587-8394 San Diego, CA 92121 >-------------------------------------------------------------------------- Dave Gampell dave@hpoclpa.hp.com "Why do you think that I speak for HP?"