I am currently writing an APS article and use:
\documentclass[%
reprint,
amsmath,amssymb,
aps,nofootinbib,
]{revtex4-1}
%
\usepackage{graphicx}
\usepackage{dcolumn}
\usepackage{bm}
\PassOptionsToPackage{linktocpage}{hyperref}
\usepackage[hyperindex,breaklinks]{hyperref}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{slashed}
\usepackage{array}
My figure captions are left aligned, as they should be. The table captions, however, are centered if I use the following code:
{\renewcommand{\arraystretch}{1.2}
\begin{table*}[t]
\centering
\begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} l l}
\hline
\hline
\multicolumn{1}{c}{ \rule{0pt}{3ex} ...} & \multicolumn{1}{c}{...} & \multicolumn{1}{c}{...} \\
\hline
... & ... & ... \\
\hline
\hline
\end{tabular*}
\caption{Centered caption.}\label{tab:1}
\end{table*}
}
How can I make the table captions left aligned (and above and not below the table) as well?
Best Answer
The
revtex4-1
document class do not offer an option to switch the unwanted behavior off, i.e. short captions are always centered. And since thecaption
package is not adapted torevtex
yet one need to patch the responsible code for yourself, e.g.:could be patched to:
As complete example document:
A more elegant solution using
\patchcmd
offered by theetoolbox
package [1]:But please be aware that patching internals of document classes or packages is usually a bad idea since internals are subject of change in future versions of the patched document class or package.
[1] See also: Please tutor the usage of patchcmd and xpatch