Graphics, Figures & Tables ⇒ Yipes! pdflatex command placing graphs in wrong place
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
Yipes! pdflatex command placing graphs in wrong place
I've been able to produce the HTML reports with graphs appearing in the right place. By right place, I mean graphs appear directly under the Doxygen text referencing them.
But, with the latex file version of the report, I run the "pdflatex" against them to produce a PDF report. The problem is the graphs in this PDF report usually appear much later in the report than the text referencing them. This is very sloppy!
I can't change the text referencing the graphs because Doxygen produces the text.
Question: Do you have any suggestions on how I can fix this problem. (I find that questions such as this are too difficult for the general Doxygen community.)
Thank you,
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Yipes! pdflatex command placing graphs in wrong place
You can prevent that by not using a figure environment and instead using a minipage to put the figure and the caption (using
\captioof{figure}{Your caption}
).As i recall from your previous thread DOXygen uses package float along with the
H
option to prevent floating.-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
Yipes! pdflatex command placing graphs in wrong place
How do I center "Your caption."Johannes_B wrote:You can prevent that by not using a figure environment and instead using a minipage to put the figure and the caption (using\captioof{figure}{Your caption}
).
Thank you,
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
Yipes! pdflatex command placing graphs in wrong place
So, how do I incorporate your code:Johannes_B wrote:instead using a minipage to put the figure and the caption (using\captioof{figure}{Your caption}
).
\captioof{figure}{Your caption}
into the following:
Code: Select all
\begin{minipage}[position]{width}
text
\end{minipage}
Thanks,
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Yipes! pdflatex command placing graphs in wrong place
captionof
.Code: Select all
\documentclass{article}
\usepackage{caption}
\begin{document}
\listoffigures
\bigbreak
\begin{minipage}{\linewidth}
\begin{center}
\rule{5cm}{4cm}
\captionof{figure}{this is my caption}
\end{center}
\end{minipage}
\end{document}
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
Yipes! pdflatex command placing graphs in wrong place
When I put that into the file (a few times), I get:Johannes_B wrote:I made a typing mistake above, please note that the command is namedcaptionof
.
Code: Select all
\documentclass{article} \usepackage{caption} \begin{document} \listoffigures \bigbreak \begin{minipage}{\linewidth} \begin{center} \rule{5cm}{4cm} \captionof{figure}{this is my caption} \end{center} \end{minipage} \end{document}
!LaTeX Error: \begin{minipage} on input line ... ended by \end{document}.
!Emergency stop.
a Fatal error occured no output PDF File produced.
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Yipes! pdflatex command placing graphs in wrong place
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Yipes! pdflatex command placing graphs in wrong place
This looks like you forgot to insertMichael_590 wrote: When I put that into the file (a few times), I get:
!LaTeX Error: \begin{minipage} on intput line ... ended by \end{document}.
\end{minipage}
at one place.Stefan
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm
Yipes! pdflatex command placing graphs in wrong place
With the Doxygen output, I went back and replaced only one figure from:
Code: Select all
My caption for the figure is this.
\nopagebreak
\begin{figure}[H]
\leavevmode
\includegraphics[width=200pt]{classone_0_0two_three_1_1graph}
\end{center}
\end{figure}
Code: Select all
\begin{minipage}{\linewidth}
\begin{center}
\rule{5cm}{4cm}
\captionof{classone_0_0two_three_1_1graph}
{My caption for the figure is this.}
\end{center}
\end{minipage}
Thank you,
-
- Posts: 51
- Joined: Wed Aug 06, 2014 6:59 pm