我想要两张并排的图像,目前正在使用以下代码:
\begin{figure}[!h]
\centering
\begin{subfigure}[t]{.45\textwidth}
\centering
\includegraphics[width=\textwidth]{./0_intro/img/cost_breakdown.png}
\caption{}
\label{fig:cost_breakdown}
\end{subfigure}
\begin{subfigure}[t]{.45\textwidth}
\centering
\includegraphics[width=\textwidth]{./0_intro/img/cost_breakdown_forecast.png}
\caption{}
\label{fig:cost_breakdown_forecast}
\end{subfigure}
\caption{\emph{Source: DOE SSL Roundtable and Workshop attendees}}
\label{fig:costs_BD_FC}
\end{figure}
我尝试改变图像的宽度,但没有效果。
有什么想法吗?谢谢!
答案1
和副标题
\documentclass{article}
\usepackage{subcaption,mwe}
\begin{document}
\begin{figure}[!h]
\centering
\begin{subfigure}[t]{.45\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-a}
\caption{}
\label{fig:cost_breakdown}
\end{subfigure}
\begin{subfigure}[t]{.45\textwidth}
\centering
\includegraphics[width=.45\textwidth]{example-image-b}
\includegraphics[width=.45\textwidth]{example-image-a}
\caption{}
\label{fig:cost_breakdown_forecast}
\end{subfigure}
\caption{\emph{Source: DOE SSL Roundtable and Workshop attendees}}
\label{fig:costs_BD_FC}
\end{figure}
\begin{figure}[!h]
\centering
\begin{subfigure}[t]{.45\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-a}
\caption{}
\label{fig:cost_breakdown}
\end{subfigure}
\begin{subfigure}[t]{.45\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-b}
\caption{}
\label{fig:cost_breakdown_forecast}
\end{subfigure}
\caption{\emph{Source: DOE SSL Roundtable and Workshop attendees}}
\label{fig:costs_BD_FC}
\end{figure}
\end{document}