Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Table and Figure side by side?

1,037 views
Skip to first unread message

Joern Lodahl

unread,
Sep 25, 1997, 3:00:00 AM9/25/97
to

At the end of a chapter I get a float page consisting of three
figures, each takin up 1/4 of the page. I have used minipage to
include two figures in one to get them side by side.

On the next page I get a small table all by itself. But the table
could easily fit in on the float page. I can do this if I changes the
table to be a figure, even though it has tabular content. It works
fine except that the caption is 'Figure' not 'Table' and it is also
numbered as a figure.

How do I fix this?

Pict1 Pict2


Pict3 Table1

Thanks in advance.

J{\o}rn
--
Joern Lodahl - I used to be a Falcon...
(remove SPAMFILTR from above address) http://www.mi.aau.dk/~jqrn/
Doing an Industrial Ph.D. in Regional Science/Operations Research.
We can learn from history that we don't learn from history!

Keith Reckdahl

unread,
Sep 25, 1997, 3:00:00 AM9/25/97
to

Joern Lodahl <jq...@mi.SPAMFILTR.aau.dk> wrote:
>At the end of a chapter I get a float page consisting of three
>figures, each takin up 1/4 of the page. I have used minipage to
>include two figures in one to get them side by side.
>
>On the next page I get a small table all by itself. But the table
>could easily fit in on the float page. I can do this if I changes the
>table to be a figure, even though it has tabular content. It works
>fine except that the caption is 'Figure' not 'Table' and it is also
>numbered as a figure.
>
>How do I fix this?


The following example defines a \tabcaption command which
produces table captions in figure environments. Similarly,
the \figcaption command produces figure captions in table
environments.

Since LaTeX allows table floats leapfrog figure floats (and
vice-versa) this may result in out-of-order figures/tables.
In the example below, the figure environment may be placed
ahead of an unprocessed table environment, this will cause the
\tabcaption table to appear ahead of the lower-numbered tables
in the unprocessed table environment. Putting a \FloatBarrier
(from the placeins package) before the figure will solve this.

Good luck,
Keith


\documentclass{article}
\usepackage{graphicx}

\makeatletter
\newcommand\tabcaption{\def\@captype{table}\caption}
\newcommand\figcaption{\def\@captype{figure}\caption}
\makeatother

\begin{document}

\begin{figure}
\begin{minipage}[b]{0.47\textwidth}
\centering
\includegraphics[width=0.8\textwidth]{file.eps}
\caption{This is a Figure by a Table}
\label{fig:by:table}
\end{minipage}%
\hfill%
\begin{minipage}[b]{0.47\textwidth}
\centering
\begin{tabular}{|c|c|} \hline
Day & Reading \\ \hline\hline
Monday & 14.6 \\
Tuesday & 14.3 \\
Wednesday & 14.2 \\
Thursday & 14.5 \\
Friday & 14.9 \\ \hline
\end{tabular}
\tabcaption{This is a Table by a Figure}
\label{table:by:fig}
\end{minipage}%
\end{figure}

\end{document}


Donald Arseneau

unread,
Sep 25, 1997, 3:00:00 AM9/25/97
to

In article <60dksk$jme$1...@nf.aau.dk>, jq...@mi.SPAMFILTR.aau.dk writes...

>At the end of a chapter I get a float page consisting of three
>figures, each takin up 1/4 of the page. ...

>On the next page I get a small table all by itself. But the table
>could easily fit in on the float page.

But it obviously doesn't fit or LaTeX woould have put it there.
I recommend you set smaller values for \@fpsep and \abovecaptionskip:

\makeatletter % *WHY* is this parameter "internal" when \textfloatsep isn't?
\setlength{\@fpsep}{4pt plus 2fil} % was 8pt plus
\makeatother
\setlength{\abovecaptionskip}{5pt}% was 10pt

Donald Arseneau as...@triumf.ca

0 new messages