遵循 G. Medina 的建议具有两个并排子图且宽度大于文本宽度的图形,我得到了想要的数字:
问题在于较长的标题会使图形不对齐:
代码:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{lipsum}
\begin{document}
\begin{figure}
\makebox[\linewidth][c]{%
\begin{subfigure}[b]{.654\textwidth}
\centering
\includegraphics[width=.95\textwidth]{../assets/20180403_all_animal_feed_spectra.pdf}
\caption{
short caption short caption short caption short caption short caption
}
\label{fig:all_animal_feed_spectra}
\end{subfigure}%
\begin{subfigure}[b]{.6\textwidth}
\centering
\includegraphics[width=.95\textwidth]{../assets/20180403_pls_baseline_rmsecv.pdf}
\caption{
10-fold RMSECV of the baseline PLS model with varying dimension of the latent space, trained on the raw data.
}
\label{fig:rmsecv_baseline}
\end{subfigure}%
}
\end{figure}
\end{document}
我猜想这个图需要分成两行:第一行用于对齐图片,第二行用于对齐标题。此外,标题之间应该留出一些自由空间。
答案1
使用 caption 包和 minipages 的替代方法:
编辑:(和caption
包但参见@Skillmon 的评论)
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\begin{figure}[!htb]
\makebox[\linewidth][c]{%
\begin{minipage}[t]{.26\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-a}
\captionof{figure}{
short caption short caption short caption short caption short caption
}
\label{fig:all_animal_feed_spectra}
\end{minipage}\begin{minipage}[b]{0.15\textwidth}\phantom{.}\end{minipage}
\begin{minipage}[t]{1.2\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-b}
\captionof{figure}{
10-fold RMSECV of the baseline PLS model with varying dimension of the latent space, trained on the raw data.
}
\label{fig:rmsecv_baseline}
\end{minipage}%
}
\end{figure}
\end{document}
迷你页面的输出[t]
:
迷你页面的输出[b]
:
答案2
如果您想要顶部对齐,则应使用[t]
选项。您使用了,因此您获得了底部对齐。subfigure
[b]
\documentclass[]{article}
\usepackage[]{graphicx}
\usepackage{duckuments}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\makebox[\linewidth][c]{%
\begin{subfigure}[t]{.45\textwidth}
\centering
\includegraphics[width=.95\textwidth]{example-image-duck}
\caption{
short caption short caption short caption short caption short caption
}
\label{fig:all_animal_feed_spectra}
\end{subfigure}%
\hfill
\begin{subfigure}[t]{.45\textwidth}
\centering
\includegraphics[width=.95\textwidth]{example-image-duck}
\caption{
10-fold RMSECV of the baseline PLS model with varying dimension of the latent space, trained on the raw data.
}
\label{fig:rmsecv_baseline}
\end{subfigure}%
}
\end{figure}
\end{document}