我需要以这种方式放置两幅图像。
我能怎么做?
这是我的代码:
\documentclass[a4paper, 11pt, titlepage]{book}
\begin{document}
\begin{figure}[!htbp]
\centering
\includegraphics[scale=0.65]{./img/doc1}
\caption{img1}
\label{fig:doc1}
\end{figure}
\begin{figure}[!htbp]
\centering
\includegraphics[scale=0.65]{./img/doc2}
\caption{img2}
\label{fig:doc2}
\end{figure}
\begin{figure}[!htbp]
\centering
\includegraphics[scale=0.65]{./img/doc3}
\caption{img3}
\label{fig:doc3}
\end{figure}
\end{document}
我的代码没有达到我想要的效果。谢谢
答案1
我建议您加载该包并在单个环境中subcaption
使用三个环境。subfigure
figure
\documentclass[a4paper, 11pt, titlepage]{book}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}{\textwidth}
\centering
\includegraphics[scale=0.65]{./img/doc1}
\caption{img1}
\label{fig:doc1}
\end{subfigure}
\bigskip
\begin{subfigure}{\textwidth}
\centering
\includegraphics[scale=0.65]{./img/doc2}
\caption{img2}
\label{fig:doc2}
\end{subfigure}
\bigskip
\begin{subfigure}{\textwidth}
\centering
\includegraphics[scale=0.65]{./img/doc3}
\caption{img3}
\label{fig:doc3}
\end{subfigure}
\caption{bla bla bla bla}
\end{figure}
\end{document}
附录:为了使用包的机制实现相同的外观subfig
,您可以使用类似以下代码:
\documentclass[a4paper, 11pt, titlepage]{book}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage{subfig}
\begin{document}
\begin{figure}
\centering
\subfloat[img1]{\includegraphics[scale=0.65]{./img/doc1}}
\label{fig:doc1}
\medskip
\subfloat[img2]{\includegraphics[scale=0.65]{./img/doc2}}
\label{fig:doc2}
\medskip
\subfloat[img3]{\includegraphics[scale=0.65]{./img/doc3}}
\label{fig:doc3}
\caption{bla bla bla bla}
\end{figure}
\end{document}