以下代码的结果显示摘要和章节标题之间的间距比标题和段落之间的间距大得多。这些间距应该相等。
\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}
如果我删除下面任意一行,错误就会停止发生。但是,我需要我的文本对齐并且没有连字符。
\emergencystretch=\maxdimen
\hyphenpenalty=10000
如果我删除摘要中的最后一个句号,问题也会消失。我该如何解决这个问题?
答案1
如果在 之前留一个空行,则不会获得多余的空间\section
。
原因是您的代码添加了不需要的空格,并且摘要的最后一行非常靠近右边距。
HERE!
在下面的代码中查找。
\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}