Graphics, Figures & Tables ⇒ Figure doing whatever it wants.
Figure doing whatever it wants.
I am trying to include the following lines: [I will mark them with **]
\section{}
\bf{title}
Plain Text
Fig.~\ref{figure}
Plain Text
** \begin{figure}[h]
\includegraphics[width=\textwidth]{run_integrate2-FvsN}
\caption{}
\label{run_integrate2-FvsN}
** \end{figure}
\\
\bf{title2}
Plain Text
ISSUE: When I run these things, the figure appears below the {title2} section, It doesn't care if I write [h, or p, or t]
it still appears at the end of that section, I do not understand why.
Your help would be really apreciated!
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
- Stefan Kottwitz
- Site Admin
- Posts: 10334
- Joined: Mon Mar 10, 2008 9:44 pm
Figure doing whatever it wants.
The code (maybe based on some older Internet sample code) is not optimal. I recommend to never use \bf and to use \\ only in tables, never in text.
It could be like this:
Code: Select all
\section{title}
Plain Text
For example, see fig.~\ref{run_integrate2-FvsN}% same as in \label
Plain Text
\begin{figure}[htbp!]
\centering%if you like
\includegraphics[width=\textwidth]{run_integrate2-FvsN}
\caption{figure caption text}
\label{run_integrate2-FvsN}
\end{figure}
\section{title2}
Plain Text
\usepackage[section]{placeins}
in the preamble.
Stefan