# Best way to get an image just HERE [duplicate]

Possible Duplicate:
Force figure placement in text

I often needed to attach an image yo my latex document and wanted it to appear just there when I imported it. I know latex is meant to put the image wherever it's best for him, but sometimes that isn't acceptable.

As an example I have big images which are meant to take almost the whole page. So I only want a page with a subsection title and then the image. It looks like there is enough space for both, but after compiling I see the subsection alone in an empty page, and then the image into the next page alone too. Or If I have to repeat this for 4 subsections, I can get 4 empty pages in a row with the subsections and then 4 pages in a row with the images.

I'm working this way because they are big schemas and I don't need to put a reference into the text, just a title and the image.

I remember using H! instead of h other times, and it didn't worked as expected either. So... how can I do this?

I took @Mico 's answer and works with one of the images I tested, but it'd doesn't for

The code used is:

\afterpage{
\chapter{Esquemáticos y PCB}
\clearpage     % flush out other floats waiting to be typeset
\begin{table}
\centering
\begin{tabular}{@{}cp{10cm}@{}}
\toprule
Nº referencia & Descripción \\
\cmidrule(l){1-1}\cmidrule(l){2-2}
3113067-01 & Esquemático del primer prototipo de placa (página 1)\\
3113067-02 & Esquemático del primer prototipo de placa (página 2)\\
3113067-03 & Esquemático del primer prototipo de placa (página 3)\\
3113067-04 & Cara TOP de la PCB del primer prototipo de placa\\
3113067-05 & Cara BOTTOM de la PCB del primer prototipo de placa\\
3113067-06 & Vías de la PCB del primer prototipo de placa\\

3113067-07 & Esquemático del diseño final de placa (página 1)\\
3113067-08 & Esquemático del diseño final de placa (página 2)\\
3113067-09 & Esquemático del diseño final de placa (página 3)\\
3113067-10 & Cara TOP de la PCB del diseño final de placa\\
3113067-11 & Cara BOTTOM de la PCB del diseño final de placa\\
3113067-12 & Vías de la PCB del diseño final de placa\\

3113067-13 & Esquemático de la placa de la tarjeta SD \\
3113067-14 & Cara TOP de la PCB de la placa de la tarjeta SD\\
3113067-15 & Cara BOTTOM de la PCB de la placa de la tarjeta SD\\
3113067-16 & Vías de la PCB de la placa de la tarjeta SD\\
\bottomrule
\end{tabular}
\caption{Referencia y descripción de los planos del Apéndice A}
\label{planostable}
\end{table}


-

## marked as duplicate by Schweinebacke, Yiannis Lazarides, Sharpie, Roelof Spijker, egregDec 14 '11 at 15:42

Just use \clearpage instead of \newpage – egreg Dec 14 '11 at 9:00
tex.ac.uk/cgi-bin/texfaq2html?label=figurehere (I would use the solution with \captionof but additionally put the graphics + the caption in a minipage to prevent a pagebreak between both.) – Ulrike Fischer Dec 14 '11 at 9:00
Additionally you can reduce the figure size a little bit using \includegraphics[width=0.8\linewidth,height=0.8\textheight,keepaspectratio]{4-F‌​irmware/img/esquemaBT1.png} – matth Dec 14 '11 at 9:03
figure is not required to get figures. It is a floating environment. If you don't want the content to float, simply don't use it. See Herbert's answer in the link above in @Schweinebacke's comment. – Martin Scharrer Dec 14 '11 at 9:30
@MartinScharrer: +1. IMO this is a very common misunderstanding about images and figures. – 0x6d64 Dec 14 '11 at 9:52

There are several strategies you may want to pursue.

• Don't use the [h] specifier, especially not by itself, unless (i) you already know that the float will fit and (ii) the float is quite small. (Because these conditions frequently aren't met, the main LaTeX document classes automatically convert [h] to [ht] or something similar.) Thus, don't be surprised if specifying [h] doesn't seem to work...

• Actually, even before starting to meddle with adjusting the float location specifiers, try making LaTeX's float placement parameters a bit more generous. For example, I usually insert the following commands in the preambles of my own papers:

\renewcommand\topfraction{0.85}
\renewcommand\bottomfraction{0.85}
\renewcommand\floatpagefraction{0.85}


Increasing the values of these parameters often succeeds in solving some obstinate float placement problems.

• To force a single float to be placed on a page by itself, you can use the \afterpage command (of the afterpage package) as follows:

 \afterpage{
\clearpage     % flush out other floats waiting to be typeset
\begin{figure} % don't use a placement specifier!
...
\end{figure}
}   % end of afterpage's argument


To place both a sectioning header and a graphic on the same page, you could specify the option [height=0.8\textheight].

• The package float provides the H -- as in I Really Want It Here -- location specifier. Using it is definitely not a panacea, and you should probably try out other, less drastic methods, before you resort to using it. However, sometimes the H specifier does seem to be more or less the only way of getting the job done.

-
it is no problem to specify [h] because it is already corrected by the documentclass! And if you want the float on an own page you can use [p] and not \afterpage – Herbert Dec 14 '11 at 10:35
@Herbert: Thanks! I've changed the first bullet point of my answer. – Mico Dec 14 '11 at 10:56

I use the wrapfig package. You can find details in the following link: http://optics.unige.ch/wikitex/WikiTexHelp/WrapFigure

-