我似乎无法删除出现在我的小节之前的空格。我知道其他帖子中讨论过这个问题,但出于某种原因,它对我来说不起作用。任何帮助都感激不尽。
\documentclass[letterpaper, fontsize=11pt]{scrartcl} % letter size paper and 11pt font size
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage{natbib}
\usepackage{color}
\usepackage{graphicx}
\newtheorem{guess}{Hypothesis}
\usepackage{titlesec}
%\setlength{\parskip}{0.4cm plus4mm minus3mm}
%\usepackage[font={small}]{caption}
%\titlespacing*{\subsection}{0pt}{0ex plus 0ex minus 0ex}{4.3ex plus .2ex}
\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\center \normalfont\scshape} % Make all sections centered, the default font and small caps
\usepackage{fancyhdr} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header
%\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
%\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\setlength\parindent{1cm} % Sets indentation of paragraphs
答案1
行中有错误
\allsectionsfont{\center \normalfont\scshape}
应该是\centering
而不是\center
,即
\allsectionsfont{\centering\normalfont\scshape}
事实上,\center
您所说的问题\begin{center}
和center
环境增加了垂直空间。
进行此更改后,分段命令前的额外间距将被删除。
平均能量损失
\documentclass[letterpaper, fontsize=11pt]{scrartcl} % letter size paper and 11pt font size
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage{natbib}
\usepackage{color}
\usepackage{graphicx}
\newtheorem{guess}{Hypothesis}
\usepackage{titlesec}
%\setlength{\parskip}{0.4cm plus4mm minus3mm}
%\usepackage[font={small}]{caption}
%\titlespacing*{\subsection}{0pt}{0ex plus 0ex minus 0ex}{4.3ex plus .2ex}
\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering\normalfont\scshape} % Make all sections centered, the default font and small caps
\usepackage{fancyhdr} % Custom headers and footers
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header
%\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
%\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\setlength\parindent{1cm} % Sets indentation of paragraphs
\usepackage{lipsum} % only for the example
\begin{document}
\section{aaa}
\lipsum[1]
\subsection{bbb}
\lipsum[1]
\end{document}
输出