I'm trying to get four figures (centered on a page in a 2×2 grid) to show up on the same page as the section heading ("Appendix").
The following puts the word "Appendix" on one page (all by itself) and then the four figures on their own page.
I've messed with \nopagebreak
, \begin{samepage}...\end{samepage}
, \begin{minipage}...\end{minipage}
with no luck.
\bibliographystyle{plain}
\bibliography{sid}
\vfill\eject
\appendix
\label{sec:ads}
\begin{figure*}
\centering
\subfigure[]{
\includegraphics[height=150pt]{./figs/jjj.png}
\label{fig:jjj}
} \quad
\subfigure[]{
\includegraphics[height=150pt]{./figs/xxx.png}
\label{fig:xxx}
} \quad
\subfigure[]{
\includegraphics[height=150pt]{./figs/nnn.png}
\label{fig:nnn}
} \quad
\subfigure[]{
\includegraphics[height=150pt]{./figs/aaaa.png}
\label{fig:aaa}
} \quad
\caption{blah }
\label{fig:aaaa}
\end{figure*}
The \vfill\eject
business is to get the word "Appendix" to appear at the top of a new page, not right after the bibliography. BTW, \appendix
has this entry in the cls
file:
\def\appendix{\par
\section*{APPENDIX}
\setcounter{section}{0}
\setcounter{subsection}{0}
\def\thesection{\Alph{section}} }
Best Answer
Obviously, in this case, you don't want your figures to float, so the natural approach would be not to use float environments. You can use
minipage
s to properly align your subfigures, and using the\captionof
command provided by the caption andsubcaption
packages you can give a caption to your subfigures and to your figure, allowing corresponding labels for cross-references. Here's a little example:I added the
demo
option to thegraphicx
package in order to make my example compilable for everyone; do not use that option in your actual code.As a side note, you seem to be using the
subfigure
package; this package is obsolete and shouldn't be used anymore; you can use thesubcaption
package instead.