使用 subfig 包时出现意外对齐

使用 subfig 包时出现意外对齐

当我使用代码时

\documentclass[twocolumn,preprintnumbers]{revtex4}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{dcolumn}
\usepackage{bm}
\usepackage{array}
\usepackage{graphicx}
\usepackage{floatrow}

\begin{document}
...
\begin{figure}
\includegraphics[width=3cm]{graph1}
\includegraphics[width=3cm]{graph2}
\caption{White sand beaches. The pink smoothness of the conch shell. A sea abundant with possibilities. Duty-free shops filled with Europe’s finest gifts and perfumes. Play your favorite game of golf amidst the tropical greens on one of the many championship courses.}
\label{Fig1}
\end{figure}
...
\end{document}

图中的标题像这样对齐

在此处输入图片描述

但是当我添加\usepackage{subfig}顶部时,图中的标题像这样对齐

在此处输入图片描述

看起来标题是居中的,但我希望标题在两边对齐,我尝试将此代码放在顶部

\usepackage{caption}
\captionsetup{justification=justified,singlelinecheck=false}

但是没用,想问一下如何让标题两边对齐。

答案1

加载subfig包为:

 \usepackage[caption=false]{subfig}

这样,您就可以保留字幕的设置revtex4。完整的 MWE:

\documentclass[twocolumn,preprintnumbers]{revtex4}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{dcolumn}
\usepackage{bm}
\usepackage{array}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\usepackage[caption=false]{subfig}


\begin{document}

\begin{figure}
    \centering
\includegraphics[width=3cm]{graph1}
\hfil
\includegraphics[width=3cm]{graph2}
\caption{White sand beaches. The pink smoothness of the conch shell. A sea abundant with possibilities. Duty-free shops filled with Europe’s finest gifts and perfumes. Play your favorite game of golf amidst the tropical greens on one of the many championship courses.}
    \label{Fig1}
\end{figure}

\end{document}

在此处输入图片描述

相关内容