看板LaTeX
标 题Re: [问题] 图片放在中央
发信站(null) (Wed Jun 5 06:21:58 2013)
转信站ptt!news.ntu!ctuews.n!news.nctu!stanfordtanford.edu!ch1no922485qab.0!n
The \newpage \pagebreak command won't work as expected, \clearpage, which has the same effect, is preferred because it suppresses floating objects to migrate.
To see this fact, try \newpage or \pagebreak instead
\documentclass[a4paper]{article}
% methods for vertically center an image
% \newpage won't work but \clearpage works
% Thus floats can move to new page
\usepackage[margin=2cm]{geometry}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}
\vspace*{\fill}
\centering
\includegraphics[width=0.4\textwidth, height=0.4\textheight]{figA}
\vspace*{\fill}
\end{figure}
\clearpage % try \newpage or \pagebreak
\begin{figure}
\centering
\includegraphics[width=0.4\textwidth, height=0.4\textheight]{figB}
\end{figure}
\clearpage % try \breakpage or \newpage
\begin{figure}
\vfil
\centering
\includegraphics[width=0.4\textwidth, height=0.4\textheight]{figC}
\vfil
\end{figure}
\end{document}