无法在子图右侧添加标题

无法在子图右侧添加标题

我正在尝试将标题放在 Beamer 中每个子图的右侧。我希望它是一个 2*2 的图;在每个子图中,其子标题都位于该子图的右侧,并有更多文本来解释该子图。因此,它将是一个包含 4 个子图和 4 个子标题的图。谢谢。

根据@Mico的解决方案修改代码以进行更多调整:

  \documentclass[demo]{beamer}
    \setbeamertemplate{caption}[numbered]% <-- added, for other option see beamer manual, page 124
    \usepackage{subcaption}

    \begin{document}
    \begin{frame}
    \begin{figure}

        \captionsetup[subfigure]{labelformat=empty}
         \begin{subfigure}{0.7\textwidth}
              \flushleft
              \begin{minipage}{0.5\linewidth}
                  \includegraphics[width=\textwidth]{Fig4}
              \end{minipage}
              \begin{minipage}{0.45\linewidth}
                  \caption{\tiny{Biological Networks: }}
                  \label{fig:BiologicalNetworks}
              \end{minipage}
          \end{subfigure}
    \hfill
         \begin{subfigure}{0.5\textwidth}
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=\textwidth]{Fig1}
            \end{minipage}
            \begin{minipage}{0.45\linewidth}
                 \caption{\tiny{Social Networks: }}
                 \label{fig:SocialNetworks}
            \end{minipage}
         \end{subfigure}

    \caption{Examples of graph data modelling}
    \label{fig:GraphModelling}
    \end{figure}

    \end{frame}
    \end{document}

答案1

如果要将子图的标题放在图形的右侧而不是下方,则需要将图形和标题说明放在单独的minipage环境中 -留出标题所占用的空间。

从下面的截图来看,我认为这种设置对读者没有好处。

在此处输入图片描述

\documentclass[demo]{beamer}
\setbeamertemplate{caption}[numbered]% <-- added, for other option see beamer manual, page 124
\usepackage{subcaption}

\begin{document}
\begin{frame}
\begin{figure}

\begin{subfigure}{0.45\textwidth}
\begin{minipage}{0.5\linewidth}
\includegraphics[width=\textwidth]{Fig4}
\end{minipage}\hfill
\begin{minipage}{0.45\linewidth}
\caption{Social Networks}
\label{fig:SocialNetworks}
\end{minipage}
\end{subfigure}
\hfill
\begin{subfigure}{0.45\textwidth}
\begin{minipage}{0.5\linewidth}
\includegraphics[width=\textwidth]{Fig4}
\end{minipage}\hfill
\begin{minipage}{0.45\linewidth}
\caption{Energy Networks}
\label{fig:EnergyNetworks}
\end{minipage}
\end{subfigure}

\caption{Examples of graph data modelling}
\label{fig:GraphModelling}
\end{figure}

See image \ref{fig:SocialNetworks} in figure \ref{fig:GraphModelling}.
\end{frame}
\end{document}


附录:我将按如下方式调整您的第二批代码:

在此处输入图片描述

\documentclass[demo]{beamer}
\setbeamertemplate{caption}[numbered]
\usepackage{subcaption,ragged2e}

\begin{document}
\begin{frame}[t] % <--- for top alignment
\begin{figure}
\captionsetup[subfigure]%
     {labelformat=empty,justification=RaggedRight}

\begin{subfigure}{0.475\textwidth}
\begin{minipage}{0.55\linewidth}
\includegraphics[width=\textwidth]{Fig4}
\end{minipage}\hfill
\begin{minipage}{0.42\linewidth}
\caption{\tiny Biological Networks: Agent based brain models for the resting state brain; Karen Joyce, Satoru Hayasaka and Paul Laurienti}
\label{fig:BiologicalNetworks}
\end{minipage}
\end{subfigure}%
\hfill % maximize space between the subfigures
\begin{subfigure}{0.475\textwidth}
\begin{minipage}{0.55\linewidth}
\includegraphics[width=\textwidth]{Fig1}
\end{minipage}\hfill
\begin{minipage}{0.42\linewidth}
\caption{\tiny Social Networks: Data: AER, JPE, Econometrica, RES, QJE (2000--present). By~Cloudly. From: www.cloudlychen.net (the higher level of connections with others)}
\label{fig:SocialNetworks}
\end{minipage}
\end{subfigure}

\caption{Examples of graph data modelling}
\label{fig:GraphModelling}
\end{figure}
A cross-reference to Figure \ref{fig:BiologicalNetworks}.
\end{frame}
\end{document}

答案2

使用包arrayadjustbox并且subcaption

在此处输入图片描述

\documentclass[demo]{beamer}
\setbeamertemplate{caption}[numbered]
\usepackage[singlelinecheck=off]{subcaption}
\usepackage{array,booktabs}
\usepackage[export]{adjustbox}

\begin{document}
\begin{frame}
\begin{figure}
    \centering
    \begin{tabular}{@{}cm{0.2\linewidth} @{} c m{0.2\linewidth}@{}}
\includegraphics[width=0.3\linewidth,valign=m]{Fig4}
    &   \subcaption{Social Networks}
        \label{fig:Social Networks}
        &   \includegraphics[width=0.25\linewidth,valign=m]{Fig1}
            &   \subcaption{Energy Networks}
                \label{fig:Energy Networks}
    \\
\addlinespace
\includegraphics[width=0.3\linewidth,valign=m]{Fig2}
    &   \subcaption{Internet}
        \label{fig:Internet}
        &   \includegraphics[width=0.25\linewidth,valign=m]{Fig3}
            &   \subcaption{Internet}
                \label{fig:Biological Networks}
    \end{tabular}
    \caption{Examples of graph data modelling}
    \label{fig:graph modelling}
\end{figure}
See images \ref{fig:Social Networks}, \ref{fig:Energy Networks} and \ref{fig:Internet} in figure \ref{fig:graph modelling}.
\end{frame}
\end{document}

附录: 根据问题的最新变化(从 4 张图片到 2 张图片,子标题中增加了更多文字),我的答案可以演变为:

\documentclass[demo]{beamer}
\setbeamertemplate{caption}[numbered]
\usepackage[singlelinecheck=off, font=scriptsize]{subcaption}
\usepackage{array,booktabs}
\usepackage[export]{adjustbox}

\begin{document}
\begin{frame}
\begin{figure}
    \centering
\setlength\tabcolsep{2pt}
    \begin{tabular}{@{}cm{0.24\linewidth}  c m{0.25\linewidth}@{}}
\includegraphics[width=0.25\linewidth,valign=m]{Fig4}
    &   \subcaption{Biological Networks:\\
                    Agent based brain models for the resting state brain; Karen Joyce, Satoru Hayasaka and  Paul  Laurienti}
        \label{fig:Social Networks}
        &   \includegraphics[width=0.25\linewidth,valign=m]{Fig1}
            &   \subcaption{Data: AER, JPE, Econometrica, RES, QJE (2000 - present).                                 By Cloudly. From: www.cloudlychen.net (the higher level of connections with others)}
                \label{fig:Energy Networks}
    \end{tabular}
    \caption{Examples of graph data modelling}
    \label{fig:graph modelling}
\end{figure}
See images \ref{fig:Social Networks}, \ref{fig:Energy Networks} in figure \ref{fig:graph modelling}.
\end{frame}

\end{document}

字体大小(令人惊讶的是)在包\tiny中不受支持,我使用在包的选项中声明的字体大小。此外,图像的大小也减小了。在确定图像和子标题的大小时,仍考虑默认框架大小(128mm x 96 mmm)。subcaption\scriptsizesubcaption\tabcolsep

在此处输入图片描述

相关内容