0

I am trying to get a caption on a figure, however when I do it using the figure environment LaTeX seems to want to put the figure wherever it wants to, even when I specify the position I want it in the [] after I enter the environment. Is there a way to get \caption{} to work outside the figure environment?

  • 2
    Welcome to TeX.SE. Please take a look at the posting Keeping tables/figures close to where they are mentioned and, in particular, this answer, which mentions the \captionof{figure}{...} command. – Mico Feb 07 '21 at 12:45
  • 1
    Welcome to TeX SX! You can use \captionof{figure}{…} (load the caption package). – Bernard Feb 07 '21 at 12:45
  • Perhaps you can add \usepackage{float} in your preamble, and use the [H] option to force LaTeX place your figure RIGHT THERE. – Jinwen Feb 07 '21 at 12:45
  • 1
    you can use \captionof{figure}{..} but note the only purpose of the figure environment s to specify that it is a float that may be moved. – David Carlisle Feb 07 '21 at 12:46
  • "wherever it wants" no, "when possible" according to your options and several rules. If the rules are too strict in your case, they can be relaxed or even ignored when needed, but it is always better fulfilled pages with displaced figures that pages with enormous blank spaces because unmovable figures cannot fit at the bottom, therefore producing a premature page break. – Fran Feb 09 '21 at 00:13

0 Answers0