Graphics, Figures & Tablessubtable

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
dill03
Posts: 4
Joined: Mon Feb 15, 2010 8:37 pm

subtable

Post by dill03 »

Hi,

I'm trying to align two tables one next to the other, using the subfigure package.
I am writing an article and have specified margins of 2.4cm left, right, top and bottom.

However, LaTeX does not want to place the tables next to each other as they must be too wide to fit. How do I force LaTeX to do this for me? I was thinking of using overhang like there is in wrapfig but could not find how to incorprate it...

Then I thought I would be able to increase the page margins just locally (increase them just for those two tables) but couldn't find out how to do that either.

Can you please help me? My LaTeX knowledge is flourishing, though still relatively new.

Here's an illustrative code:

Code: Select all

\documentclass[a4paper,11pt]{article} 
\usepackage[left=2.4cm,right=2.4cm,top=2.4cm,bottom=2.4cm]{geometry} 
\usepackage{subfigure}
\usepackage{multirow}

\begin{document}

Text text text Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\begin{table}[h]
  \begin{center}
	\subtable[SCWO LCA]{{} \label{table:scwolca1}
  		\begin{tabular}{l l c c}
\hline \hline
\multirow{2}{*}{Material}	&Amount		&Indicator		&Total\\
					&(hr$^{-1}$) 	&(mPts/kg)	&(mPts)\\
\hline
\multicolumn{4}{c}{Production}\\
\hline
Steel			&238,051 kg	&86		&20,472,386\\
\hline
\multicolumn{4}{c}{Use}\\
\hline
Electricity		&22,967 kWh	&33		&757,911\\
Phenol		&16 kg		&99		&1574\\
O2			&31 kg		&12		&374\\
\hline
\multicolumn{4}{c}{Disposal}\\
\hline
CO2		&40 kg		&53		&2,131\\
Phenol		&2 kg		&99		&157\\
Wastewater	&792 kg		&0.026	&21\\
\hline
\multicolumn{3}{r}{Total}		&21,234,600\\
\hline
		\end{tabular}
}
	\subtable[MARS LCA]{{} \label{table:marslca1}
  		\begin{tabular}{l l c c}
\hline \hline
\multirow{2}{*}{Material}	&Amount		&Indicator		&Total\\
					&(hr$^{-1}$)	&(mPts/kg)	&(mPts)\\
\hline
\multicolumn{4}{c}{Production}\\
\hline
Steel				&47,967 kg		&86		&4,125,162\\
\hline
\multicolumn{4}{c}{Use}\\
\hline
Electricity			&1,135 kwh	&33		&37,434\\
Phenol			&17 kg		&99		&1,661\\
\multicolumn{2}{l}{Silcone Rubber}	&360	&0\\
HCL				&7.2 kg		&39		&284\\
NaOH			&8 kg			&38		&304\\
\hline
\multicolumn{4}{c}{Disposal}\\
\hline
Phenol			&0.54 kg		&99		&53\\
NaCl				&12 kg		&7		&82\\
Wastewater		&992 kg		&0.026	&26\\
\hline
\multicolumn{3}{r}{Total}						&4,165,00\\
\hline
		\end{tabular}
}
    \caption{Life Cycle Analysis for \subref{table:scwolca1} SCWO and \subref{table:marslca1} MARS} \label{table:lca}
  \end{center}
\end{table}

Text text text Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

subtable

Post by localghost »

The subfigure package is obsolete [1]. Furthermore it can cause trouble in conjunction with hyperref. Although it is not maintained any more, you can use the subfig package for the present.

You can just decrease th font size of the tables by using an appropriate switch.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2.4cm]{geometry}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage[font=footnotesize]{subfig}
\usepackage{blindtext}
\usepackage{multirow}

\begin{document}
  \blindtext
  \begin{table}[!ht]
    \caption{Life Cycle Analysis for \subref{table:scwolca1} SCWO and \subref{table:marslca1} MARS}\label{table:lca}
    \footnotesize
    \centering
    \subfloat[SCWO LCA\label{table:scwolca1}]{% 
      \begin{tabular}{llcc} \hline \hline
        \multirow{2}{*}{Material} & Amount & Indicator & Total \\
        & (hr$^{-1}$) & (mPts/kg) & (mPts) \\ \hline
        \multicolumn{4}{c}{Production} \\ \hline
        Steel & 238,051 kg & 86 & 20,472,386 \\ \hline
        \multicolumn{4}{c}{Use} \\ \hline
        Electricity & 22,967 kWh & 33 & 757,911 \\
        Phenol & 16 kg & 99 & 1574 \\
        O2 & 31 kg & 12 & 374 \\ \hline
        \multicolumn{4}{c}{Disposal} \\ \hline
        CO2 & 40 kg & 53 & 2,131 \\
        Phenol & 2 kg & 99 & 157 \\
        Wastewater & 792 kg & 0.026 & 21 \\ \hline
        \multicolumn{3}{r}{Total} & 21,234,600 \\ \hline
      \end{tabular}
    }
    \subfloat[MARS LCA\label{table:marslca1}]{%
      \begin{tabular}{llcc} \hline\hline
        \multirow{2}{*}{Material} & Amount & Indicator & Total \\
        & (hr$^{-1}$) & (mPts/kg) & (mPts) \\ \hline
        \multicolumn{4}{c}{Production} \\ \hline
        Steel & 47,967 kg & 86 & 4,125,162 \\ \hline
        \multicolumn{4}{c}{Use} \\ \hline
        Electricity & 1,135 kwh & 33 & 37,434 \\
        Phenol & 17 kg & 99 & 1,661 \\
        \multicolumn{2}{l}{Silcone Rubber} & 360 & 0 \\
        HCL & 7.2 kg & 39 & 284 \\
        NaOH & 8 kg & 38 & 304 \\ \hline
        \multicolumn{4}{c}{Disposal} \\ \hline
        Phenol & 0.54 kg & 99 & 53 \\
        NaCl & 12 kg & 7 & 82 \\
        Wastewater & 992 kg & 0.026 & 26 \\ \hline
        \multicolumn{3}{r}{Total} & 4,165,00 \\ \hline
      \end{tabular}
    }
  \end{table}
  \blindtext
\end{document}
[1] View topic: Obsolete packages and document classes - Avoid usage!


Best regards and welcome to the board
Thorsten
Post Reply