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:

  1. 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.

  2. Try \allowdisplaybreaks in the preamble.

  3. Try \raggedbottom in the preamble.

  4. If none of those work then post a complete example demonstrating your actual problem.

Share:
2,864

Related videos on Youtube

Graham Streich
Author by

Graham Streich

Updated on August 01, 2022

Comments

  • Graham Streich
    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.

    enter image description here

    I tried using a variety of \vspace commands but could not get anything to work.

    • Zarko
      Zarko over 4 years
      Please provide small but complete document which reproduce your problem. Instead of real text you can use dummy text from package lipsum or blindtext. Form provided fragments it is impossible to say, what went wrong with your document.
    • Graham Streich
      Graham Streich over 4 years
      Thank 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
      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
      Graham Streich over 4 years
      I see. I do not know exactly how to do that...is there any general command for removing spacing?
    • Zarko
      Zarko over 4 years
      if 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
      JPi over 4 years
      Also, why do you have a \section command inside a center environment? Do you want the section title to be centered? Look at the titlesec package.
  • Graham Streich
    Graham Streich over 4 years
    Thank you for your help! I'm learning a lot of Latex today.
  • JPi
    JPi over 4 years
    Use \clearpage instead of \newpage if you want the floats to stay with their section.
  • Graham Streich
    Graham Streich over 4 years
    What are floats?
  • JPi
    JPi over 4 years
    Tables and figures