I am working on latex document. My packages are
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{color}
\usepackage{ragged2e}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}
\setcounter{tocdepth}{6}
\setcounter{secnumdepth}{6}
Everything is fine but when the first subsection is completed and I use the next section command \section{blah blah}
, it starts on a new page. I have abundant space in the same page and hence I don't want the page break. I even used \nopagebreak
command and it's still the same. Please help!
The \nolinebreak command prevents LaTeX from breaking the current line at the point of the command. With the optional argument, number, you can convert the \nolinebreak command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is.
The \clearpage command ends the current page and causes all figures and tables that have so far appeared in the input to be printed.
The \pagebreak command tells LaTeX to break the current page at the point of the command. With the optional argument, number , you can convert the \pagebreak command from a demand to a request.
Remove the
\newcommand{\sectionbreak}{\clearpage}
command and use \pagebreak where ever required. That satisfies your requirement. Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With