如何向上移动非数字章节,但只是其中一个而不是全部? scrbook

如何向上移动非数字章节,但只是其中一个而不是全部? scrbook

我有这个文档模板,其中编号章节是定制的。我怎样才能减少非编号章节中上边距和标题之间的空间。我想通过上移摘要的标题来增加几行。但仅限于特定章节,其他章节都可以。

以下是 MWE:

% ***********************  Document Class Definition **********************
\documentclass[twoside,12pt,headings=optiontoheadandtoc]{scrbook}
% ********************  Configure Packages  *****************************
\usepackage[a4paper,    % showframe,
            hmargin=2.5cm, vmargin=3cm,
            includefoot=false]{geometry}
\usepackage[main=UKenglish]{babel}
\usepackage[T1]{fontenc}        
\usepackage[dvipsnames]{xcolor}
\usepackage[pdftex]{graphicx}
\usepackage{minitoc}
\usepackage{titletoc}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\usepackage{xhfill}     %Use in the design for section titles
\usepackage{scrhack}
\usepackage{tikz}
\usetikzlibrary{decorations,
                decorations.pathmorphing,
                decorations.pathreplacing}
% ---------------------------------------------------------------
\usepackage[sfdefault]{universalis}

%% Define some format spacing--------------------------------------------------------
\setparsizes{1em}{1em plus .1\baselineskip}{0pt plus 1fil}
\renewcommand{\baselinestretch}{1.25}\selectfont

%% Define color used within the template---------------------------------------------
\definecolor{maincolor}{cmyk}{1, .50, .10, .01}
\definecolor{coloraccessory}{cmyk}{.18, .98, .18, 0}
\colorlet{colorfooterpage}{maincolor}
\colorlet{colorfootertitle}{maincolor}
\colorlet{colorfootermark}{coloraccessory}

%% Formating the caption labels for floating elements ------------------------------
\setkomafont{caption}{\normalfont\footnotesize}
\setkomafont{captionlabel}{\color{coloraccessory}\usekomafont{caption}\bfseries}

%% Title format for Chapters -------------------------------------------------------
\newcommand{\ssfont}{\fontfamily{bch}\selectfont}  % For font Charter
\newcommand{\thesischapterfont}{\color{maincolor}\normalfont\huge\ssfont}
\newcommand{\thesissectionfont}{\color{maincolor}\normalfont\Large\ssfont}
\newcommand{\thesissubsectionfont}{\color{maincolor}\normalfont\large\ssfont}
\newcommand{\fontfootertext}{\color{colorfootertitle}\normalfont\footnotesize}
\newcommand{\fontfooterpagenumber}{\color{colorfootermark}\normalfont\normalsize\bfseries}
% headings
\setkomafont{chapter}{\thesischapterfont}           % for chapter entries
\setkomafont{section}{\thesissectionfont}           % for section entries
\setkomafont{subsection}{\thesissubsectionfont}     % for section entries
\setkomafont{subsubsection}{\thesissubsectionfont}     % for section entries

%%  formats: \chapters
\renewcommand*\chapterheadstartvskip{\vspace*{3cm}}
\renewcommand*{\chapterformat}{ \chapternumber{\thechapter} }
\renewcommand{\chapterlinesformat}[3]{ #2\leavevmode\linebreak\chaptertitle{#3} }
\newcommand{\chapternumber}[1]{ \usekomafont{chapter}
    \begin{minipage}[t]{1\textwidth}%
        \raggedleft{%
            {\color{maincolor}\fontsize{60}{60}\selectfont#1}%
        }%
    \end{minipage}
    
    \begin{tikzpicture}[cap=round,line width=6pt,maincolor]
      \draw[line width=2pt ] (0,0) -- (1.0\linewidth,0);
      \draw (0.7\linewidth,0) -- (1.0\linewidth,0);
    \end{tikzpicture}
}
\newcommand{\chaptertitle}[1]{ \usekomafont{chapter}
    \begin{minipage}[t]{1\textwidth}%
        \vspace*{0.5cm}
        \raggedright%
        #1%
    \end{minipage}%
}
\renewcommand*\chapterheadendvskip{\vspace*{2cm}}

%% -----------------------------------------------------------------------------------------
% Adjusting spacing around section/subsection titles
\RedeclareSectionCommand[
  %runin=false,
  afterindent=false,
  beforeskip=1.0\baselineskip,
  afterskip=0.5\baselineskip]{section}
  
\RedeclareSectionCommand[
  %runin=false,
  afterindent=false,
  beforeskip=.75\baselineskip,
  afterskip=.5\baselineskip]{subsection}
\RedeclareSectionCommand[
  %runin=false,
  afterindent=false,
  beforeskip=.5\baselineskip,
  afterskip=.25\baselineskip]{subsubsection}

%% -----------------------------------------------------------------------------------------
%%  formats: \section 
\renewcommand{\sectionlinesformat}[4]{%
\Ifstr{#1}{section}{%
    \parbox[r]{\linewidth}{%
      \kern-.75\ht\strutbox\rule{\linewidth}{1.2pt}\par%
      \raggedsection{\hskip #2{\color{black}#3}}{#4}\par%
    }%
  }{%
    {\hskip #2#3}{#4}}% 
}

%% -----------------------------------------------------------------------------------------
%%  formats: \subsection
    \renewcommand*{\subsectionformat}{%
        \usekomafont{subsection}%
        \color{black}\thesubsection\hspace*{10pt}
    }

%****************************** Document begins *******************************
\begin{document}
%******************************** Front Matter ********************************     
\frontmatter
\pagestyle{plain}
\chapter*{dedication}
    \lipsum[1-3]
\chapter*{declaration}
    \lipsum[1-3]
\chapter*{Abstract}
    \lipsum[1-3]

%*********************** Adding TOC ***********************
\frontmatter 
\pagestyle{empty}
\tableofcontents
% ******************************** Main Matter *********************************
\mainmatter
\pagestyle{scrheadings}
% Chapter 1 -----------------------------------
  \chapter{Introduction}
  \lipsum[1-3]
  \section{Nice section title}
  \lipsum[1-5]
  \section{Very boring section}
  \lipsum[1-3]
% Chapter 2 -----------------------------------
\chapter{Optimal Control for Wave Energy Converters: Contributions}
  \lipsum[1-3]
  \section{Nice section title}
  \lipsum[1-5]
  \section{Very boring section}
  \lipsum[1-3]

\end{document}

总而言之,我想减少这个空间:

在此处输入图片描述

而不修改其他未编号的章节。

谢谢您的指导!

答案1

使用\renewcommand*\chapterheadstartvskip{...\renewcommand*\chapterheadendvskip{..限制其范围\chapter{abstract}

例如

{\renewcommand*\chapterheadstartvskip{\vspace*{-1.5cm}}
\renewcommand*\chapterheadendvskip{\vspace*{0cm}}
\chapter*{Abstract}
}

A

相关内容