How does one make a figure appear precisely where it is placed in the coding, as opposed to the top of the next page? This is an issue for me currently.
1 Answers
Use float.sty. Then use H as the position specifier.
Normally, we use [!tbp] as float position specifier to place our floats. Here the interpretations are,
t (Top) - at the top of a text page.
b (Bottom) - at the bottom of a text page.
p (Page of floats) - on a separate float page, which is a page containing no text, only floats.
Should you want to place where you want it, you will use the h (for ‘here’) specifier. Even if you use the placement specifier h, the figure or table will not be printed here if doing so would break the rules. Under that circumstances, you want to send a stronger message and you will want to go for the above mentioned H solution.
When put the ! LaTeX overrides certain internal parameters it uses for determining good float positions.
\documentclass{article}
\usepackage{float}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{figure}[H]
\centering
HERE
\caption{Place it here}
\label{fig:h}
\end{figure}
\lipsum[2]
\end{document}
\lipsum is only for dummy text, in case it confuses you in any manner.
- 17,842
\captionofcommand is probably the better way to go. – Thorsten Donig Nov 09 '13 at 07:04