2

The result of the code below shows a spacing between the abstract and the section title that's much larger than the spacing between the title and the paragraph. These spacings should be equal.

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}

\emergencystretch=\maxdimen
\hyphenpenalty=10000

\makeatletter
\if@titlepage\else
  \renewenvironment{abstract}{%
      \if@twocolumn\else
          {\bfseries\centering\MakeUppercase{\abstractname} \\
          \vspace{\baselineskip}}%
      \fi}
\fi
\renewcommand\section{
  \@startsection {section}{1}{\z@}
  {-\baselineskip}
  {\baselineskip}
  {\normalfont\normalsize\bfseries}
 }
\makeatother

\begin{document}
\begin{abstract}
    Palavras-chave: Processamento de fluxo distribuído; Apache Flink; Backpressure; Big Data; Estruturas de processamento distribuído; Sobrecarga local; Otimização de recursos.Otimização de recursos. euismod.
\end{abstract}
\section{Introduction}
\lipsum[2]
\end{document}

enter image description here

If I remove either of the lines below, the error stops occurring. However, I need my text to be justified and without hyphenation.

\emergencystretch=\maxdimen
\hyphenpenalty=10000

The problem also stops if I remove the last period inside the abstract. How can I fix this?

4
  • What would be the reason for suppressing hyphenation?
    – egreg
    Aug 13, 2023 at 14:40
  • It is a norm of my institution that I need to follow. Aug 13, 2023 at 14:44
  • 1
    Amazing! It seems they really want badly typeset theses.
    – egreg
    Aug 13, 2023 at 14:46
  • it really makes no sense to justify the text if hyphenation is not allowed. Aug 13, 2023 at 16:59

1 Answer 1

3

You'd not get the excess space if you leave a blank line before \section.

The reason is that your code adds an unwanted space and the last line of the abstract ends very near to the right margin.

Look for HERE! in the code below.

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}

\emergencystretch=\maxdimen
\hyphenpenalty=10000

\makeatletter
\if@titlepage\else
  \renewenvironment{abstract}{%
      \if@twocolumn\else
          {\bfseries\centering\MakeUppercase{\abstractname} \\
          \vspace{\baselineskip}}%
      \fi}{\par}% <-- HERE! 
\fi
\renewcommand\section{% <--- HERE!
  \@startsection {section}{1}{\z@}
  {-\baselineskip}
  {\baselineskip}
  {\normalfont\normalsize\bfseries}
 }
\makeatother

\begin{document}
\begin{abstract}
    Palavras-chave: Processamento de fluxo distribuído; Apache Flink; Backpressure; Big Data; Estruturas de processamento distribuído; Sobrecarga local; Otimização de recursos.Otimização de recursos. euismod.
\end{abstract}
\section{Introduction}
\lipsum[2]
\end{document}

enter image description here

2
  • % from @egreg, what a shock Aug 13, 2023 at 17:00
  • @DavidCarlisle Amazing indeed!
    – egreg
    Aug 13, 2023 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .