0

I use ACM template in this page to write my thesis. There is a huge blank space between sections as the figure demonstrate. I have refer to this post and use input{} to input sections, but the blank still exist, any suggestion?

I have reproduce my problem in this overleaf link, hope this can help.

Normally it will only have 2 blank space between section, but in my reproduce file, there is 3 or more blank line between section.

Normal output: enter image description here

Reproduced error output:

enter image description here

Paul Gessler
  • 29,607
S.F. Yeh
  • 25
  • 1
  • 5
  • That image does not explain much, exactly what are in these files that are inputted? Not that since you are using \input here, you can collect everything in one file and post it here. That makes it a lot easier for us to work with – daleif Jul 26 '21 at 11:16
  • Is this better now? – S.F. Yeh Jul 26 '21 at 11:56
  • 1
    Well, next make the sniplet into something others can test directly, here there is no document class or relevant packages. The collored image from overleaf is not really relevant. – daleif Jul 26 '21 at 12:03
  • but My latex just look like this lol. I use one file and code input{} to call out other .tex and the I format the content in the way I demonstrated – S.F. Yeh Jul 26 '21 at 12:47
  • I'm sure that if you open an overleaf template there will be some files at the right of you screen. In there you will see a class (.cls file) or something containing relevant definitions. Without those definitions it is imposible to know what is going on, and that's the meaning of "next time make the snipet into something others can test directly". None of your snipers can be tested by others and we don't know which ACM template are you using, so it is imposible to help – Luis Turcio Jul 26 '21 at 12:59
  • @LuisTurcio oh, sorry. I do not know that. I just update my post and refer to the acm template I'm using, I also reproduce my problem in the overleaf link. Hope this full latex code file did work for your kindness help. – S.F. Yeh Jul 26 '21 at 13:38
  • I guess you are using \flushbottom but as you have shown no code that is impossible to determine. Try \raggedbottom. – Peter Wilson Jul 26 '21 at 18:25
  • The .cls document is too large, so I put the link in the text. Hope you can refer to it – S.F. Yeh Jul 28 '21 at 06:06
  • often good old \vspace{-2em} is your best bet – Neil Oct 13 '22 at 21:28

1 Answers1

4

TeX is trying to fill the page to the best of its ability.

The acmart class puts glue (elastic space) before and after the section title to allow a good break in the text when filling the page.

You can reduce the allowed (+)vertical space by redefining the command \section.

Then, in this case, the white space will appear at the bottom of the page because the next page begins with a subsection and obviously does not fit there.

The change will take effect throughout the document.

For consistency, it will be better to do the same, at least, with subsections.

Before

a

After

b

Add the code to your preamble:

\makeatletter
\renewcommand\section{\@startsection{section}{1}{\z@}%
    {-.75\baselineskip \@plus -.2\p@ \@minus -.2\p@}% before \@plus -2\p@ <<<
    {.25\baselineskip}%
    {\ACM@NRadjust\@secfont}}

\renewcommand\subsection{@startsection{subsection}{2}{\z@}% {-.75\baselineskip @plus -.2\p@ @minus -.2\p@}% before @plus -2\p@<<< {.25\baselineskip}% {\ACM@NRadjust@subsecfont}}

\makeatother

Simon Dispa
  • 39,141