使用小页面进行奇怪的子图索引

使用小页面进行奇怪的子图索引

在此处输入图片描述

本文档中有两幅图。第二幅图使用 minipages 将其子图与表格放在一起(如这个答案),遗憾的是第二个表的子图没有标记为 ab 而是 cd;可能是因为它们被错误地看作是第一个图的一部分(如上所示)。

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\renewcommand\thesubtable{(\alph{subtable})}
\usepackage{array}
\usepackage[all]{xy}
% for \extrasrrowheight
%\usepackage{siunitx}

\begin{document}

\begin{figure}
    \centering
    %ERC1
    \begin{subfigure}[b]{0.4\textwidth}
    \[
    \xymatrix{
        *+[o][F]{C^*} \ar@<-.5ex>[d]_{k_{a1}(R-x_1-x_2)} \\
    *+[o][F]{x_1 }\ar@<-.5ex>[u]_{k_{d1}} 
    }
    \]
    \caption{Single binding configuration}
    \label{ERC1diagram}
    \end{subfigure}    
        %ERC2
    \begin{subfigure}[b]{0.4\textwidth}
    \[
    \xymatrix{
                 &*+[o][F]{C^*} \ar@<-.5ex>[dl]_{k_{a1}(R-x_1-x_2)}   \ar@<.5ex>[dr]^{k_{a2}(R-x_1-x_2)}  &  \\
    *+[o][F]{x_1 }\ar@<-.5ex>[ur]_{k_{d1}} &                                                      & *+[o][F]{x_2 }\ar@<.5ex>[ul]^{k_{d2}}
    }
    \]
    \caption{Two binding configurations}
    \label{ERC2diagram}
    \end{subfigure}    
\caption[Compartmental diagram of the effective rate constant model]{Compartmental diagram of the ERC model with concentration of analyte at the reaction chip's surface $C^*$, and concentrations of bound analyte $x_1(t)$ and $x_2(t)$.}
\label{ERCdiagram}
\end{figure}
\noindent
\begin{figure}
    \centering
    %VIs
        \begin{minipage}[b]{0.45\textwidth}
    %\begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{ERC_Kd_varies_a2.png}
        \captionof{subfigure}{Association phase}
        \label{Lng1AssPhase}
    %\end{subfigure}
    \end{minipage}
    \begin{minipage}[b]{0.45\textwidth}
    %\begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{ERC_Kd_varies_d3.png}
        \captionof{subfigure}{Dissociation phase}
        \label{Lng1AssPhase}
    %\end{subfigure}
    \end{minipage}\\
     \begin{minipage}[b]{1\textwidth}
    %\begin{subfigure}[b]{1\textwidth}
        \centering
        \includegraphics[scale=1.2]{ERC_kd_varies_legend4.png}
     \end{minipage}%{subfigure}
\caption{Graphs of bound antibody $x_1$ against time $t$ for the Langmuir single configuration model (green dashed line) and the ERC model for different values of $k_m$.}
%\captionof{figure}{Graphs of bound antibody $x_1$ against time $t$ for the Langmuir single configuration model (green dashed line) and the ERC model for different values of $k_m$.}
\label{fig:kc_varies}
%\end{figure}
%\begin{table}
\vspace{\floatsep}
\centering
\footnotesize
\begin{tabular}
{ | c | c | c | c | c |  }
\hline
Parameter           &$k_{a}$                   & $k_{d}$ &     $R$                   & $C_T$   \\
                          &M$^{-1}$s$^{-1}$ &s$^{-1}$& pg nm$^{-2}$ & nM   \\\hline
Value                  &6E-4                       &7E-3        & 500 & 100   \\\hline
\end{tabular}
\captionof{table}{Values taken by parameters in Fig. \ref{fig:kc_varies} that are not varied}
\label{tab:LwTsols}
\end{figure}
\end{document}

答案1

\captionof仅适用于浮动环境(例如figure或 )table,而不适用于子环境(例如subfigure或 )subtable。不幸的是,这会导致奇怪的行为和错误的格式,而不是错误消息。[1]

改用\subcaption

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\renewcommand\thesubtable{(\alph{subtable})}
\usepackage{array}
\usepackage[all]{xy}
% for \extrasrrowheight
%\usepackage{siunitx}

\begin{document}

\begin{figure}
    \centering
    %ERC1
    \begin{subfigure}[b]{0.4\textwidth}
    \[
    \xymatrix{
        *+[o][F]{C^*} \ar@[d]_{k_{a1}(R-x_1-x_2)} \\
    *+[o][F]{x_1 }\ar@[u]_{k_{d1}} 
    }
    \]
    \caption{Single binding configuration}
    \label{ERC1diagram}
    \end{subfigure}    
        %ERC2
    \begin{subfigure}[b]{0.4\textwidth}
    \[
    \xymatrix{
                 &*+[o][F]{C^*} \ar@[dl]_{k_{a1}(R-x_1-x_2)}   \ar@[dr]^{k_{a2}(R-x_1-x_2)}  &  \\
    *+[o][F]{x_1 }\ar@[ur]_{k_{d1}} &                                                      & *+[o][F]{x_2 }\ar@[ul]^{k_{d2}}
    }
    \]
    \caption{Two binding configurations}
    \label{ERC2diagram}
    \end{subfigure}    
\caption[Compartmental diagram of the effective rate constant model]{Compartmental diagram of the ERC model with concentration of analyte at the reaction chip's surface $C^*$, and concentrations of bound analyte $x_1(t)$ and $x_2(t)$.}
\label{ERCdiagram}
\end{figure}
\noindent
\begin{figure}
    \centering
    %VIs
        \begin{minipage}[b]{0.45\textwidth}
    %\begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{ERC_Kd_varies_a2.png}
        \subcaption{Association phase}
        \label{Lng1AssPhase}
    %\end{subfigure}
    \end{minipage}
    \begin{minipage}[b]{0.45\textwidth}
    %\begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{ERC_Kd_varies_d3.png}
        \subcaption{Dissociation phase}
        \label{Lng1AssPhase}
    %\end{subfigure}
    \end{minipage}\\
     \begin{minipage}[b]{1\textwidth}
    %\begin{subfigure}[b]{1\textwidth}
        \centering
        \includegraphics[scale=1.2]{ERC_kd_varies_legend4.png}
     \end{minipage}%{subfigure}
\caption{Graphs of bound antibody $x_1$ against time $t$ for the Langmuir single configuration model (green dashed line) and the ERC model for different values of $k_m$.}
%\captionof{figure}{Graphs of bound antibody $x_1$ against time $t$ for the Langmuir single configuration model (green dashed line) and the ERC model for different values of $k_m$.}
\label{fig:kc_varies}
%\end{figure}
%\begin{table}
\vspace{\floatsep}
\centering
\footnotesize
\begin{tabular}
{ | c | c | c | c | c |  }
\hline
Parameter           &$k_{a}$                   & $k_{d}$ &     $R$                   & $C_T$   \\
                          &M$^{-1}$s$^{-1}$ &s$^{-1}$& pg nm$^{-2}$ & nM   \\\hline
Value                  &6E-4                       &7E-3        & 500 & 100   \\\hline
\end{tabular}
\captionof{table}{Values taken by parameters in Fig. \ref{fig:kc_varies} that are not varied}
\label{tab:LwTsols}
\end{figure}
\end{document}

由于subfigure环境只不过是启用minipage\caption的,因此可以写成:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\renewcommand\thesubtable{(\alph{subtable})}
\usepackage{array}
\usepackage[all]{xy}
% for \extrasrrowheight
%\usepackage{siunitx}

\begin{document}

\begin{figure}
    \centering
    %ERC1
    \begin{subfigure}[b]{0.4\textwidth}
    \[
    \xymatrix{
        *+[o][F]{C^*} \ar@[d]_{k_{a1}(R-x_1-x_2)} \\
    *+[o][F]{x_1 }\ar@[u]_{k_{d1}} 
    }
    \]
    \caption{Single binding configuration}
    \label{ERC1diagram}
    \end{subfigure}    
        %ERC2
    \begin{subfigure}[b]{0.4\textwidth}
    \[
    \xymatrix{
                 &*+[o][F]{C^*} \ar@[dl]_{k_{a1}(R-x_1-x_2)}   \ar@[dr]^{k_{a2}(R-x_1-x_2)}  &  \\
    *+[o][F]{x_1 }\ar@[ur]_{k_{d1}} &                                                      & *+[o][F]{x_2 }\ar@[ul]^{k_{d2}}
    }
    \]
    \caption{Two binding configurations}
    \label{ERC2diagram}
    \end{subfigure}    
\caption[Compartmental diagram of the effective rate constant model]{Compartmental diagram of the ERC model with concentration of analyte at the reaction chip's surface $C^*$, and concentrations of bound analyte $x_1(t)$ and $x_2(t)$.}
\label{ERCdiagram}
\end{figure}
\noindent
\begin{figure}
    \centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{ERC_Kd_varies_a2.png}
        \caption{Association phase}
        \label{Lng1AssPhase}
    \end{subfigure}
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{ERC_Kd_varies_d3.png}
        \caption{Dissociation phase}
        \label{Lng1AssPhase}
    \end{subfigure}\\
    \begin{subfigure}[b]{1\textwidth}
        \centering
        \includegraphics[scale=1.2]{ERC_kd_varies_legend4.png}
    \end{subfigure}
\caption{Graphs of bound antibody $x_1$ against time $t$ for the Langmuir single configuration model (green dashed line) and the ERC model for different values of $k_m$.}
%\captionof{figure}{Graphs of bound antibody $x_1$ against time $t$ for the Langmuir single configuration model (green dashed line) and the ERC model for different values of $k_m$.}
\label{fig:kc_varies}
%\end{figure}
%\begin{table}
\vspace{\floatsep}
\centering
\footnotesize
\begin{tabular}
{ | c | c | c | c | c |  }
\hline
Parameter           &$k_{a}$                   & $k_{d}$ &     $R$                   & $C_T$   \\
                          &M$^{-1}$s$^{-1}$ &s$^{-1}$& pg nm$^{-2}$ & nM   \\\hline
Value                  &6E-4                       &7E-3        & 500 & 100   \\\hline
\end{tabular}
\captionof{table}{Values taken by parameters in Fig. \ref{fig:kc_varies} that are not varied}
\label{tab:LwTsols}
\end{figure}
\end{document}

[1]https://gitlab.com/axelsommerfeldt/caption/issues/14

相关内容