2

I'm writing a document and want to include an appendix of pictures at the end. Each picture has a caption associated with it, and a label. However, each time I try to compile the code, LaTeX automatically creates a page break between the section heading and the first figure. I know that use of \includegraphics can create a page break, but even if I use the figure environment without a picture as below, LaTeX starts a new page between the section heading and caption. Any ideas how I can stop this from happening?

\section{Appendix A}
\begin{figure}
    \centering
    \caption*{BlaBlaBla}
    \label{pic1}
\end{figure}
  • Have a look at http://tex.stackexchange.com/questions/2275/keeping-tables-figures-close-to-where-they-are-mentioned – texenthusiast Feb 18 '14 at 17:32
  • Hi @texenthusiast I've already tried this, e.g. using [!ht], but it does not work – user2524828 Feb 18 '14 at 17:39
  • If you don't want the image to move don't put it in a figure environment. – David Carlisle Feb 18 '14 at 17:50
  • @DavidCarlisle - what do you suggest? – user2524828 Feb 18 '14 at 17:51
  • NB, I have also tried using the afterpage package – user2524828 Feb 18 '14 at 17:51
  • 1
    just use \includegraphics directly. If you also want to caption it (which isn't really needed for a non floating figure) use \captionof{figure}{my caption here} from the capt-of or caption packages. The only reason to use figure is to allow latex to move the figure. – David Carlisle Feb 18 '14 at 17:52
  • @DavidCarlisle - how does the figure labeling work in this case for reference in the rest of the document? – user2524828 Feb 18 '14 at 17:54
  • 2
    \captionof is identical to \caption except that you can use it outside the figure environment. (the whole package is just one line of code that defines \captionof to call \caption, so any labelling or caption styling works as required) – David Carlisle Feb 18 '14 at 17:56

0 Answers0