0

I am using overleaf.

In the following code when I tried to write text , it appeared in frist page , while I want the text to be in 5th page or 6th page. I tried commands as \pagebreak or \newpage but it didn't work.

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{amsmath,amssymb,amsthm}
\newtheorem{theorem}{Theorem}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{question}{Question}
\title{Project 02}
\author{Mahmoud}
\date{\today}

\begin{document}

\maketitle \begin{question} Sketch the directed and undirected power graphs of finite group $G$ where $G=\mathbf{Z}{6}$, $Q{8}$.\

\begin{figure}[h] \centering \includegraphics[scale=.3]{example-image} \caption{Undirected power graph of $\mathbf{Z}_{6}$} \label{fig:my_label} \end{figure}

\end{question}

\begin{figure}[h] \centering \includegraphics[scale=.35]{example-image} \caption{Directed power graph of $\mathbf{Z}_{6}$} \label{fig:my_label} \end{figure}

\begin{figure}[h] \centering \includegraphics[scale=.50]{example-image} \caption{Undirected power graph of $Q_{8}$} \label{fig:my_label} \end{figure}

\begin{figure}[h] \centering \includegraphics[scale=.50]{example-image} \caption{Directed power graph of $Q_{8}$} \label{fig:my_label} \end{figure}

\begin{question} Sketch the undirected power graph of finite group $G$ where \ $G=\mathbf{Z}{8},\mathbf{Z}{9},\mathbf{Z}{10},$ and The Klein $4-$ group $V{4}$. \end{question}

\begin{figure}[h] \centering \includegraphics[scale=.25]{example-image} \caption{Undirected power graph of $\mathbf{Z}_{8}$} \label{fig:my_label} \end{figure}

\begin{figure}[h] \centering \includegraphics[scale=.25]{example-image} \caption{Directed power graph of $\mathbf{Z}_{8}$} \label{fig:my_label} \end{figure}

\begin{figure}[h] \centering \includegraphics[scale=.25]{example-image} \caption{Undirected power graph of $\mathbf{Z}_{9}$} \label{fig:my_label} \end{figure}

\begin{figure}[h] \centering \includegraphics[scale=.25]{example-image} \caption{Directed power graph of $\mathbf{Z}_{9}$} \label{fig:my_label} \end{figure}

\begin{figure}[h] \centering \includegraphics[scale=.30]{example-image} \caption{Undirected power graph of $\mathbf{Z}_{10}$} \label{fig:my_label} \end{figure}

\begin{figure}[h] \centering \includegraphics[scale=.30]{example-image} \caption{Directed power graph of $\mathbf{Z}_{10}$} \label{fig:my_label} \end{figure}

\begin{figure}[h] \centering \includegraphics[scale=.30]{example-image} \caption{Undirected power graph of $V_{4}$} \label{fig:my_label} \end{figure}

\begin{figure}[h!] \centering \includegraphics[scale=.30]{example-image} \caption{Directed power graph of $V_{4}$} \label{fig:my_label} \end{figure}

%Here I want add text, my file is five pages , but it adds the text at first page after second question

\end{document}

  • 2
    Off-topic: It seems, that you have a lot of images, that should not float. So IMHO it would be better not to use figure environments, but \captionof of package caption or figure extension of package float. – cabohah Mar 27 '23 at 16:07
  • 2
    I'm not seeing which text should be at the 5th or 6th page. – Teepeemm Mar 27 '23 at 16:21
  • @Teepeemm I mean when I tried to write more text , it would be written directly after the text in page 1 – Mahmoud albahar Mar 27 '23 at 16:29
  • 2
    @Mahmoudalbahar In this case maybe my off-topic comment is not off-topic. Floats can float, even if they are h-floats, because the h does not mean: “place the float here and nowhere else”, it just means: “place the float here, if here would be suitable, depending on all the float parameters”. → https://tex.stackexchange.com/questions/39017/ and https://tex.stackexchange.com/questions/8625 – cabohah Mar 27 '23 at 16:34
  • 2
    you could use example-image so people can use your example. As it is it is hard to guess your problem. which text appears on page 1 that you expect on page 5? – David Carlisle Mar 27 '23 at 16:42
  • 1
    To consolidate the above comments: please [edit] your post to use example-image instead of the .png files, and include the phrase "this should be on page 5". That way we can paste what you've typed and see the output. As things are, you're describing a problem with code you haven't shown us, which makes it hard to debug. – Teepeemm Mar 27 '23 at 16:57
  • @Teepeemm I will edit now, thank you for your help. – Mahmoud albahar Mar 27 '23 at 17:02
  • @Teepeemm I've done the editing , I am stuck in this problem since yesterday . – Mahmoud albahar Mar 27 '23 at 17:06
  • 1
    It appears that the main idea is what cabohah noted: {figure}[h] still allows the figure to move around to where LaTeX thinks best. Both of the linked questions have answers along the lines of "if you don't want the image to float, then don't use {figure}." You can also use Thomkrates' suggestion of adding \clearpage, which will force the figures to appear, and then your text. – Teepeemm Mar 27 '23 at 17:16

1 Answers1

1

Try \clearpage or if you load the package nextpage the commands \cleartooddpage or \cleartoevenpage.

  • I think I delete my answer, since the question is not sufficiently described. – Thomkrates Mar 27 '23 at 17:01
  • Now that the question is better described, it appears that you have provided a possible solution. – Teepeemm Mar 27 '23 at 17:13
  • Did you try it? Did it come out as intended (with \clearpage)? I did not try it, just guessing out of experience. So \clearpage is something like a stop for float objects. Isnt it? – Thomkrates Mar 27 '23 at 17:18
  • @cabohah \clearpage (or not using figure) is the answer here – David Carlisle Mar 27 '23 at 21:26
  • @DavidCarlisle But only, if the OP wants an almost empty page before the Here I want add text … … And now, the edited question is absolutely a duplicate. – cabohah Mar 28 '23 at 07:15
  • Depending on the amount of text and figures (content, in general) it can by no means be avoided - as far as I understand - to have "an almost empty page before", since it is the nature of some certain amount of content not to fit completely in a certain free and left space. You can stretch with \flushbottom or to the contrary with \raggedbottom if you have text; I use the latter to avoid paragraph stretching, which is not nice. But with the latter you get adequate and well set text pages. The empty space at the end of a chapter, is the the "breath of freedom" for the reader of the book. – Thomkrates Mar 28 '23 at 09:12