chap-crop20151002210627设计代码如下:

\documentclass[a4paper]{book} %
%
\usepackage[fleqn]{amsmath} %
\usepackage{amsthm,amssymb} %
\usepackage[explicit]{titlesec} %
\usepackage{titletoc} %
\usepackage[english]{babel} %
\usepackage{txfonts} %
\usepackage{xcolor}
\usepackage{colortbl} %

\usepackage[format=plain,listformat=empty,labelsep=space,position=below,width=\linewidth, labelfont={normal},font={normal}]{caption} %

\usepackage[margin=6pt,justification=raggedright]{subcaption} %

\usepackage[paperwidth=170mm, paperheight=240mm, textwidth=132mm,verbose, driver=none, showcrop, showframe]{geometry}
%
\usepackage[a4,frame,center]{crop}
\usepackage[most]{tcolorbox}
\usepackage{bookmark} % %
%
\setlength{\unitlength}{1mm} %

\definecolor{ThemeColour}{rgb}{0.45,0.00,0.45} %
\definecolor{DarkGrey}{rgb}{0.92,0.92,0.92}
\definecolor{DarkRed}{rgb}{0.45,0.00,0.00} %
\definecolor{LightCream}{rgb}{1.00,1.00,0.90} %

\newcommand\Hrule{\noindent\color{ThemeColour}{\rule{\linewidth}{3pt}}} %
\newcommand\hseprule{\color{DarkRed}{\rule{\linewidth}{0.7pt}}} %

\titleformat{\chapter}[display]
{\color{ThemeColour}\bfseries\itshape\fontsize{30}{30}\selectfont} %
{\Hrule\vspace*{6pt}\\ {\color{black}\,\chaptername\hspace{8pt}\normalfont\fontsize{42}{45}\selectfont{\thechapter}}} %
{0pt}{\bfseries\normalfont\fontsize{15}{18}\selectfont{#1} \\ \vspace*{-9pt}\Hrule}[\vspace{18pt}] %

\titlespacing{\chapter}{0pt}{12pt}{6pt}[0pt] %
\renewcommand{\thechapter}{\arabic{chapter}} %

\newtcolorbox{sectionbox}[2][]{nobeforeafter, boxsep=4.2pt,boxrule=1.2pt,arc=3pt,outer arc=3.2pt,width=\linewidth,
coltitle=white,colbacktitle=ThemeColour,after=\hfill,colframe=black,colback=DarkGrey,title={#2},fonttitle=\bfseries,#1}

\titleformat{\section} %
  {\normalfont\bfseries\itshape\fontsize{12}{14}\selectfont}
  {}{0pt}
{\begin{sectionbox}
{\fontsize{14}{16}\selectfont{Section\hspace{5.6pt}\thetitle}}{#1}
\end{sectionbox}}

\titlespacing{\section}{0pt}{10pt}{6pt}[0pt] % 0, 10, 6, 0
\renewcommand{\thesection}{\arabic{section}} % make-up of number
%
\def\figtab{\kern 0.8pt}

\addto\captionsenglish{ % this seems to work
\renewcommand{\figurename}{Fig\hspace{0.7pt}.} %
\renewcommand{\thefigure}{\thechapter{\figtab.\figtab}\arabic{figure}} % good
\renewcommand{\thesubfigure}{\hspace{0.5pt}\alph{subfigure}\hspace{0.4pt}} %
}
\raggedbottom

\begin{document}

\pagestyle{plain}

\chapter{Introduction to number}

\section{Section one - only small gap above (ok)}

\section{Section two - directly follows section one - gap ok}

\section{Section three - directly follows section two}

\clearpage

\section{Section four - shows 40mm gap at the top of the page (far too much)}

\section{Section five - directly follows section four - gap ok}

\section{Section six} \vspace{50mm}

\noindent Even though the page is nearly full.\vspace{50mm}

\noindent Even though the page is nearly full.

\end{document}

编译方式:pdfLaTeX,xeLaTeX均可,测试系统:windows+TeXLive2015. 选自:http://tex.stackexchange.com/questions/269457/why-does-section-command-cause-large-vertical-space-before-only-at-top-of-page/269469

点赞(1)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部