0

I have the following latex file for the figures. The figures are read successfully but it does not align itself in the desired space between horizontal text lines, instead it jumps to the next page. For instance:

[first some sentences...........................................................................................................] [I want my figures to be in this line....................................................................................................]
[Next some sentences.............................].   

Please find my latex file below: Let us consider the following graphs:

\begin{figure}{}
\centering
\begin{subfigure}{.5\textwidth}
  \centering
\includegraphics[height=5.8em]{C:/Users/abc/Documents/formula1}
  \caption{Fig: $G_1~~~~~~~~~$}
  \label{fig:sub1}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
  \centering
\includegraphics[height=5.8em]{C:/Users/abc/Documents/formula2}
  \caption{Fig: $G_2~~~~~~~$}
  \label{fig:sub2}
\end{subfigure}
\begin{subfigure}{.5\textwidth}
\centering
\includegraphics[height=7.8em]{C:/Users/abc/Documents/formula3}
\caption{$G_1\triangledown G_2$}
\label{fig:sub2}
\end{subfigure}
\label{fig:test}
\end{figure}
In the graph $G_1$, the pair of non adjacent vertices whose end vertices are not $G_2$ are (5, 4) and (5, 6).  

Note. I want my figures to be aligned in the space between 'first some sentences' and 'next some sentences' as mentioned above, but here it jumps to the next page

gete
  • 251
  • 1
    it is almost impossible to understand the question, what do you mean by "jumps off to bottom" we can not run the code fragment and you have shown no output. Please try to make a small complete test document that shows the problem (you can use example-image as the image as it is available for this sort of test) – David Carlisle May 19 '19 at 10:47
  • 1
    note that the only reason to use \begin{figure} is to specify the content is not part of the main document flow and is a float that may be moved to help with page breaking. So if you just mean that the figure moved that is by design and expected. – David Carlisle May 19 '19 at 10:49
  • 1
    I think also that you are discovering what is a float, one one the nicest features of LaTeX but confusing at first for new users. You should read carefully this question: https://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat – Fran May 19 '19 at 10:50
  • 1
    If you refer to the content as See Figure \ref{fig:test} rather than refiring to "above" or "below" then the sentence makes sense wherever the figure is inserted. – David Carlisle May 19 '19 at 10:53
  • @David Carlisle I have edited the question. Is it clear now? – gete May 19 '19 at 11:06
  • @gete yes as I tried to show in later comments I guessed what you mean. As I say the only reason to use figure there is to allow the figure to move, so there is not really any issue to solve, it is working as expected. – David Carlisle May 19 '19 at 11:58
  • This question is probably a duplicate of https://tex.stackexchange.com/questions/2275/keeping-tables-figures-close-to-where-they-are-mentioned – David Carlisle May 19 '19 at 12:00
  • @David Carlisle, It's fixed now . Actually i should have put H as \begin{figure}[H]...Thanks – gete May 19 '19 at 13:40
  • No really you should only use [H] in very rare circumstances. (I implemented [H] but it is mis-used so often that I often regret it). – David Carlisle May 19 '19 at 13:42

0 Answers0