Large figure disturbs the positioning of other

Asked

Viewed 1,746 times

4

In a Latex report I’m writing, I’m trying to insert a large figure at the beginning of the chapter. It’s a page-sized flowchart:

\begin{figure}[!htb]
  \centering
  \includegraphics[width=\textwidth]{visio/fluxograma} % fluxograma é um PDF
  \caption{Fluxograma descrevendo a metodologia.}
  \label{fig:methodology}
\end{figure}

What is happening is that, because it is the size of a page, Latex is postponing the insertion of the figure to the end of the chapter, after the text. As the flowchart is only inserted at the end, it hinders the insertion of the other figures that are in the middle of the chapter. Hence, the figures are all at the end of the chapter.

Question
How do I insert the flowchart in the correct position?

I tried to put the attributes [!htb] in the flowchart, but it didn’t help. By changing the size to 80% I could, but I wanted to keep it with the page size.

  • 2

    Just for the record, there’s another Stack Exchange group Q&A specific to Tex/Latex questions (in English): http://tex.stackexchange.com/ Not that I think your question doesn’t fit here, but just so you know it exists (because it can help you in the future with other issues). :)

2 answers

3

Figures and tables are floating elements (floating), and so Latex takes care of choosing the best place to place them according to the available space and the size of the element.

An alternative that might work for you is not to use the tag \begin{figure} and exchange it for a centralised generic element \begin{center}. Try it like this:

\usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption}

\begin{center}
    \includegraphics[width=\textwidth]{visio/fluxograma} % fluxograma é um PDF
    \captionof{figure}{Fluxograma descrevendo a metodologia.}
    \label{fig:methodology}
\end{center}

EDIT: Includes package usage caption (which is necessary for the use of \captionof)

  • 1

    I just found this Tex(en) question that may also be useful to you: http://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat The accepted answer has a whole explanation about how the element fluctuation algorithm works and the second answer is on the line I offered here.

  • Hi Luiz, I took a look at the page you indicated to me. You won’t believe it, but just to include the argument p (for pages) solved my problem. It was like this \begin{figure}[!htbp]. You can include this in your reply as well?

  • 1

    @Victorhugo What mass that worked then! I could easily include it in my answer, but I don’t think it’s befitting because it’s another type of solution/suggestion. Why don’t you add an answer describing your own solution? I think it looks better. :)

  • 1

    Great, Luiz Vieira. I added the answer. Thank you! :)

3


In the link @Luiz Vieira indicated, there was the parameter p that I had not yet tested. It specifies for the figure that it can be positioned on a page or a column. I just added this parameter that worked without problems:

\begin{figure}[!htbp]
  \centering
  \includegraphics[width=\textwidth]{visio/fluxograma} % fluxograma é um PDF
  \caption{Fluxograma descrevendo a metodologia.}
  \label{fig:methodology}
\end{figure}

A single character solved :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.