我对 LaTeX 有一个大问题,因为我不能在新章节之前删除边距
我什么都试过了,但我很新,我没能做到。我的代码:
\documentclass[polish,12pt,oneside]{mwbk}
\usepackage[a4paper,includeheadfoot,inner=3.0cm,outer=2.5cm,top=3cm,bottom=3cm]{geometry}
\linespread{1.416}
\usepackage{lipsum}
\clubpenalty=10000
\widowpenalty=10000
\usepackage{fancyhdr}
\pagestyle{plain}
\setlength{\headsep}{2em}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\usepackage[utf8]{inputenc}
\usepackage[polish]{babel}
\usepackage{polski}
\usepackage[pagebackref=false]{hyperref}
\bibliographystyle{plplain}
\usepackage{dirtree}
\usepackage{varwidth}
\usepackage[labelsep=period]{caption}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepackage{subcaption}
\usepackage{float}
\usepackage{wasysym}
% THE CODE I'VE TRIED
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
% --- Patch \chapter
\patchcmd{\@makechapterhead}{50\p@}{\chapheadtopskip}{}{}% Space from top of page to CHAPTER X
\patchcmd{\@makechapterhead}{20\p@}{\chapheadsep}{}{}% Space between CHAPTER X and CHAPTER TITLE
\patchcmd{\@makechapterhead}{40\p@}{\chapheadbelowskip}{}{}% Space between CHAPTER TITLE and text
% --- Patch \chapter*
\patchcmd{\@makeschapterhead}{50\p@}{\chapheadtopskip}{}{}% Space from top of page to CHAPTER TITLE
\patchcmd{\@makeschapterhead}{40\p@}{\chapheadbelowskip}{}{}% SPace between CHAPTER TITLE and text
\makeatother
% Set new lengths
\newlength{\chapheadtopskip}\setlength{\chapheadtopskip}{5pt}
\newlength{\chapheadsep}\setlength{\chapheadsep}{5pt}
\newlength{\chapheadbelowskip}\setlength{\chapheadbelowskip}{5pt}
% END THE CODE I'VE TRIED
\begin{document}
\selectlanguage{polish}
\addtocounter{page}{1}
\setcounter{tocdepth}{1}
\tableofcontents
\setlength{\parskip}{0.5ex}
\chapter{Hardware}
\label{ch:hardware}
\section{Components}
\label{sec:components}
\lipsum[3-7]
\cleardoublepage
\phantomsection
\listoffigures
\end{document}
带有 titlesec 包的方法给了我一堆错误。我用的是背页。
改变
\documentclass[polish,12pt,oneside]{mwbk}
至
\documentclass[polish,12pt,oneside]{book}
有帮助,但会破坏另一种样式(如枚举列表等)