I have some text at the end of my page and I would put it at the beginning of the next page.which could be the best way to have this result?
[Tex/LaTex] put ending text at the beginning of next page
page-breakingpositioning
Related Solutions
Here is a solution, assuming you generally want the plain
page style with only the page number at the bottom. The only thing that I couldn't fix is the space between the "continued" lines and the actual text. Suggestions on that are welcome! I added the italics, you can just remove that if you don't like it. This code will add the "continued" texts no matter if the text you pass to \mytextbox
actually breaks onto the next page or not.
Once you start messing with the page layout, further adaptions might be necessary.
\documentclass{article}% This only works for one-side documents! For two-side documents, more meddling with oddfoot and evenfoot is necessary.
\usepackage{lipsum}% filler text
\usepackage{afterpage}% for commands to be executed after the page
\usepackage{fancyhdr}% for direct access to headers and footers
\usepackage{array}% improved tables
\makeatletter
% Define new page style "contbottom"
\newcommand{\ps@contbottom}{%
\renewcommand{\@oddhead}{}% empty header
\renewcommand{\@oddfoot}{%
\begin{tabular}{@{}>{\raggedright}p{.4\linewidth}@{}>{\centering}p{.2\linewidth}@{}>{\raggedleft}p{.4\linewidth}@{}}% table to get spacing correct
\textit{**Continued on next page**} &% = footer left
~\\\thepage &% = footer center, put empty line above page number
% = footer right
\end{tabular}}%
}
% Define new page style "conttop"
\newcommand{\ps@conttop}{%
\renewcommand{\@oddhead}{\textit{**Continued from previous page**}\hfill}% header
\renewcommand{\@oddfoot}{\begin{tabular}{@{}>{\raggedright}p{.4\linewidth}@{}>{\centering}p{.2\linewidth}@{}>{\raggedleft}p{.4\linewidth}@{}}% table to get spacing correct
&% = footer left
~\\\thepage &% = footer center, empty line as well so all pages look the same
% = footer right
\end{tabular}}%
}
\makeatother
% Put page number one line lower for normal pages
\pagestyle{plain}
\fancyfoot[C]{~\\\thepage}
% Define command \mytextbox
\newcommand{\mytextbox}[1]{%
\thispagestyle{contbottom}% page style contbottom for this page
\afterpage{\thispagestyle{conttop}}% page style conttop for the next page
#1% print text
}
\begin{document}
\lipsum[1-6]
\mytextbox{\lipsum}
\lipsum[1-6]
\end{document}
Try it as:
{
\centering
\includegraphics[width=\linewidth]{geschw.png}
\captionof{figure}{Geschwindigkeitsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
\includegraphics[width=\linewidth]{beschl.png}
\captionof{figure}{Beschläunigungsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
\label{fig:geschw}
}
The first thing you need to ask yourself when dealing with pictures is, if you want them to float or not. In your case you do not. This will give you more control but requires a greater amount of intervention in your part to set the correct spacing around them. Overflowing into the bottom margins might also force you to include manual page breaks.
Please also note the use of \captionof
from the caption
package to include a caption, textdoc caption
for more details and a plethora of useful settings. Also note that the images might look better with a combined caption rather than two, please experiment to see what works best in your case.
Best to always include a full MWE with a question as shown below for the solution:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,lipsum}
\begin{document}
\section{First}
\lipsum[1-2]
{
\centering
\includegraphics[width=\linewidth]{geschw.png}
\captionof{figure}{Geschwindigkeitsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
\includegraphics[width=\linewidth]{beschl.png}
\captionof{figure}{Beschläunigungsverläufe von Globoidkurve und Greifer bei 0,7s Wechselzeit}
\label{fig:geschw}
}
\end{document}
Best Answer
As ArTourter pointed out, the command
\newpage
should work.This webpage has a nice overview of the many ways to start new lines and start new pages, including an explanation of the difference between
\newpage
and\pagebreak
.You might also want to read the answers to this question.