我正在尝试将 bubcaption 更改为顶部,但找不到使用 subfigure 包的方法。无法添加 captio/subcaption 包,因为它们与 subfigure 包崩溃,而且我已经看完了很长的文档的一半。我输入的内容如下:
\begin{figure}[h]
\centering
\subfigure{A}
\includegraphics[scale=0.35]{kinase/grapmorpfirstadd}
\label{subfigure:kinmorfirst}
\hspace{1mm}
\subfigure{B}
\includegraphics[scale=0.35]{kinase/grapdamgofirstadd}
\label{subfigure:kindamgofirst}
\caption[Concentration response curve in the presence of 1$\mu$M PMA]{Concentration response curve in the presence of 1$\mu$M PMA (A) Morphine treatment (B) DAMGO treatment}
\label{figure:kinfirstadd}
\end{figure}
A 或 B 位于左下角,我希望它们位于左上角。 谢谢
答案1
请勿在新文档中使用此代码。 subfigure
已弃用,不应使用。请改用subfig
或subcaption
。
您可以使用adjustbox
来对齐事物:
\usepackage{graphicx,subfigure,adjustbox}
\begin{document}
\begin{figure}[h]
\centering
\mbox{}%
\adjustbox{valign=T}{\subfigure{A}}
\adjincludegraphics[valign=T,scale=0.35]{example-image-a}
\label{subfigure:kinmorfirst}
\hspace{1mm}
\adjustbox{valign=T}{\subfigure{B}}
\adjincludegraphics[valign=T,scale=0.35]{example-image-a}
\label{subfigure:kindamgofirst}
\caption[Concentration response curve in the presence of 1$\mu$M PMA]{Concentration response curve in the presence of 1$\mu$M PMA (A) Morphine treatment (B) DAMGO treatment}
\label{figure:kinfirstadd}
\end{figure}
\end{document}
答案2
这是一个使用强大的floatrow
组合包装subcaption
(subfig
也可能是一种选择);由于标签是自动圆顶的,您可以轻松地交叉引用子图:
\documentclass{article}
\usepackage{floatrow}
\usepackage{subcaption}
\usepackage{graphicx}
\renewcommand\thesubfigure{\Alph{subfigure}}
\begin{document}
Some references to Figure~\ref{fig:test} and its subfigures~\ref{sfig:testa} and~\ref{sfig:testb}.
\begin{figure}
\floatsetup[subfigure]{style=plain,heightadjust=object,
capbesideposition={left,top},capbesidesep=space}
\ffigbox[\FBwidth]
{%
\begin{subfloatrow}\useFCwidth
\fcapside[\FBwidth]
{\caption{}\label{sfig:testa}}
{\includegraphics[width=4cm]{example-image-a}}
\fcapside[\FBwidth]
{\caption{}\label{sfig:testb}}
{\includegraphics[width=4cm]{example-image-b}}
\end{subfloatrow}%
}
{\caption{A figure with two subfigures}\label{fig:test}}
\end{figure}
\end{document}
我同意成本加运费,您不应该subfigure
再使用过时的软件包。