Remove white space at the start of new section in latex
2,864
\documentclass[12pt,letterpaper,nofootinbib,notitlepage,tightenlines]{revtex4-1}
\linespread{2}
\usepackage[letterpaper,margin=1in,bottom=1in]{geometry}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{center}
\section{THEORY \& HYPOTHESES}
\label{sec:analysis}
\end{center}
\blindtext
\clearpage
\blindtext
\section{THEORY \& HYPOTHESES}
\blindtext
\end{document}
A few pointers:
Don't put
\section
inside a center environment. Look at the two pages produced by the code above side by side and you'll see that doing so creates extra space.Try
\allowdisplaybreaks
in the preamble.Try
\raggedbottom
in the preamble.If none of those work then post a complete example demonstrating your actual problem.
Related videos on Youtube
Author by
Graham Streich
Updated on August 01, 2022Comments
-
Graham Streich over 1 year
Using this code:
\RequirePackage[l2tabu,orthodox]{nag} \documentclass[12pt,letterpaper,nofootinbib,notitlepage,tightenlines]{revtex4-1} \linespread{2} \usepackage[letterpaper,margin=1in,bottom=1in]{geometry} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{microtype} %\raggedbottom \usepackage[bottom]{footmisc} \renewcommand{\footnoterule}{\kern -1ex\rule{0.3\linewidth}{0.5pt} \\ \vspace{1ex}} \usepackage{amsmath} \pagestyle{plain} \usepackage{setspace} \usepackage{blindtext} \usepackage{caption} \captionsetup{font={small,stretch=1}} %\usepackage[bottom,multiple]{footmisc} \usepackage{graphicx} \usepackage{bm} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{indentfirst} \usepackage{lipsum} \usepackage{float} \newcommand{\forceindent}{\leavevmode{\parindent=8em\indent}} \begin{document} \begin{center}\section{THEORY \& HYPOTHESES} \label{sec:analysis}
to create the following new section and, as you can see, when the code is compiled the outcome includes a large vertical space. The same thing does not occur for any of my other sections despite using the exact same code pattern.
I tried using a variety of \vspace commands but could not get anything to work.
-
Zarko over 4 yearsPlease provide small but complete document which reproduce your problem. Instead of real text you can use dummy text from package
lipsum
orblindtext
. Form provided fragments it is impossible to say, what went wrong with your document. -
Graham Streich over 4 yearsThank you, I edited my question. I am very new to latex and I did not write the original code so I am confused on how to shorten it in an appropriate manner.
-
Admin over 4 years@GrahamStreich you remove all the parts that don't make a difference, often doing so you discover a poor sequence / duplicate or rouge out of sync item just adding \lipsum[1] \end{center} \end {document} to your mwe I see No problem
-
Graham Streich over 4 yearsI see. I do not know exactly how to do that...is there any general command for removing spacing?
-
Zarko over 4 yearsif this is article for some journal, don't worry about this space. They will managed all formatting issues of article. This space is partly influenced by article content which follows this paragraph (is there some figure/table with placement option
H
?) and partly by used double spacing. For test try replace all option[H]
with[ht]
at your floats (figure
/table
) and remove\linespread{2}
in preamble. -
JPi over 4 yearsAlso, why do you have a
\section
command inside acenter
environment? Do you want the section title to be centered? Look at thetitlesec
package.
-
-
Graham Streich over 4 yearsThank you for your help! I'm learning a lot of Latex today.
-
JPi over 4 yearsUse
\clearpage
instead of\newpage
if you want the floats to stay with their section. -
Graham Streich over 4 yearsWhat are floats?
-
JPi over 4 yearsTables and figures