I have the following code:
\documentclass[letterpaper,12pt]{article}
% things needed to include figures
\usepackage{subfigure, graphicx}
% float must be included for the [H] to actually work
\usepackage{float}
% formulas
\usepackage{amsmath}
% Added to adjust captions
\usepackage[singlelinecheck=false]{caption}
% added to adjust margins at the suggestion of Dr. Matt
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{fullpage}
\begin{document}
% 2 column side by side table
\begin{table}[H]
\subtable[Half-life for $^{108}$Ag] {%
% -----------------------------------------------------%
\begin{tabular}{c@{\hskip 1cm} c}
\hline\noalign{\smallskip}
Accepted $T_{1/2}$ & Experimental $T_{1/2}$\\
(s) & (s)\\
\hline\noalign{\smallskip}
142.92 & 158 $\pm$ 7\\
\hline\noalign{\smallskip}
\end{tabular}
\label{lefttable}
% -----------------------------------------------------%
}
\subtable[Half-life for $^{110}$Ag] {%
% -----------------------------------------------------%
\begin{tabular}{c@{\hskip 1cm} c}
\hline\noalign{\smallskip}
Accepted $T_{1/2}$ & Experimental $T_{1/2}$\\
(s) & (s)\\
\hline\noalign{\smallskip}
24.6 & 21 $\pm$ 2\\
\hline\noalign{\smallskip}
\end{tabular}
\label{righttable}
% -----------------------------------------------------%
}
\caption{2 Column tables side by side}
\label{sidebysidetable}
\end{table}
\end{document}
That produces this result:
I'd like the captions to be left aligned. How would I go about doing this?
Best Answer
To your question:
subcaption
package supports thecaption
package and use its\captionsetup
interface.where
raggedright
is left aligned.In the problem subfigure-and-subfig-packages-deprecated,
subcaption
is recommended.instead of
subfigure
.And I change your subtable environment style:
And output is![enter image description here](https://i.stack.imgur.com/7oZ2q.png)
Noting that the overall width (lefttable + righttable) should be less than
\textwidth
. And the option in[b]
is vertical position for that sub-table. In your case, same height tables would makeb
andt
no difference.