0

Tables, graphs and images don't show up at the same position it was inserted in the TeX file. I tried to suppress floating by using:

\usepackage{float}
...
\begin{figure}[H] {15cm}
\caption{}%
\label{}
\fbox{\includegraphics[width=\hsize]{image.jpeg}}
\end{figure}

also

\begin{figure}[!htbp] {15 cm}
...

\usepackage{placeins}
\FloatBarrier
\begin{figure}[H] {15cm}
...

but these commands keep insisting on moving figures, tables and graphs to unexpected locations. I'm using repUERJ template available here

Does anyone know why it happens?

Bernard
  • 271,350
phill
  • 3
  • 1
    \FloatBarrier has to go after the figure to prevent the figure from being placed after that point – Au101 May 09 '18 at 14:42
  • 2
    H is almost always a guarantee for bad placement – samcarter_is_at_topanswers.xyz May 09 '18 at 14:43
  • 3
    also \begin{figure}[H] {15cm} would just write 15cm in to the output, if you have loaded the float package [H] will never float from the source position. (if you have not loaded float then [H] should give an error unless you have an old latex (when it will force the float to the end of the document) – David Carlisle May 09 '18 at 14:44
  • 2
    If you need specific help you should always provide a small complete test example that can be run to debug the problem. – David Carlisle May 09 '18 at 14:45
  • 5
    also of course you can just use \includegraphics the reason to use figure is to mark the content as being not in the main document flow and can be moved to help with page breaking, so it not being output at that position isn't a problem, it is the main purpose of the environment. – David Carlisle May 09 '18 at 14:48
  • 3
    As David just mentioned, to avoid floating, avoid the figure environment. – Johannes_B May 09 '18 at 14:59
  • Using just \includegraphics does not work for me. I need to arrange my images in a list of images, therefore \label, \caption and \source are important. – phill May 09 '18 at 17:21
  • Maybe provide a full MWE (https://tex.meta.stackexchange.com/questions/228) and use example images (https://tex.stackexchange.com/questions/231738) and make clear what your desired output should look like. The \source command (mentioned in one of your comments) is not known to me. Maybe it's defined in the repUERJ document class that you are referring to. – Dr. Manuel Kuehner May 10 '18 at 12:06
  • @samcarter, it's a legacy default behavior for word processor users: "I want it here because I want it and that's where I want it. Period". –  May 13 '18 at 00:36

0 Answers0