我遇到一个问题,即我的章节的顶部边距很大,而底部边距却很小,这是我用于章节的代码:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
%\usepackage[ngerman]{babel}
\usepackage{tikz-cd}
\usepackage{mathtools}
\usepackage{commath}
\usepackage{bbm}
\usetikzlibrary{babel}
\usetikzlibrary{shapes.geometric}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{titlesec}
\newtheorem{theorem}{Theorem}
\newtheorem{prop}{Proposition}
\usepackage[nottoc]{tocbibind} % For adding List of Tables and List of Figures to Table of Contents
\usepackage[titles]{tocloft}
\makeatletter
\def\ps@headings{%
\def\@oddfoot{\normalfont\hfil\thepage\hfil}%
\def\@evenfoot{\normalfont\hfil\thepage\hfil}}
\def\@evenhead{\hfil\slshape\leftmark}%
\def\@oddhead{{\slshape\rightmark}\hfil%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter. \ %
\fi
\fi
##1}}{}}%
\def\sectionmark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
\thesection. \ %
\fi
##1}}}}
\makeatother
\pagestyle{headings}% apply new definitions
\begin{document}
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries}
{\titleline{}\vspace{5pt}\titleline{}\vspace{1pt}%
\MakeUppercase{\chaptertitlename} \thechapter}
{1pc}
{\titleline{}\vspace{0.5pc}}
\chapter{INTRODUCTION}
\section{MOTIVATION}
\end{document}
有什么建议吗?我猜我的代码中的问题出在这部分:
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries}
{\titleline{}\vspace{5pt}\titleline{}\vspace{1pt}%
\MakeUppercase{\chaptertitlename} \thechapter}
{1pc}
{\titleline{}\vspace{0.5pc}}
我需要顶部边距为 1.5 英寸,底部边距为 1 英寸。
答案1
您希望缩小上边距和章节标题之间的间距。在这种情况下,您只需\titleformat
按照问题中提到的方式编辑命令即可。
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries}
{\titleline{}\vspace{1pt}\titleline{}\vspace{-0.9in}% The negative value here to move chapter title up
\MakeUppercase{\chaptertitlename} \thechapter}
{1pc}
{\titleline{}\vspace{0.5pc}}