如何减少上边距和章节号框之间的空间?

如何减少上边距和章节号框之间的空间?

我是 LaTex 新手,急需帮助。我想减少灰色框(章节号)和页面顶部之间的距离,以便在每章开头留出更多空间,但我似乎无法在下面附加的 tex. 文件中控制这一点。您能否帮助我了解如何减少我所指的距离?

% Chapter style (taken and slightly modified from Lars Madsen Memoir Chapter 
% Styles document
\usepackage{calc,soul,fourier}
\makeatletter 
\newlength\dlf@normtxtw 
\setlength\dlf@normtxtw{\textwidth} 
\newsavebox{\feline@chapter} 
\newcommand\feline@chapter@marker[1][4cm]{%
    \sbox\feline@chapter{% 
        \resizebox{!}{#1}{\fboxsep=1pt%
            \colorbox{gray}{\color{white}\thechapter}% 
        }}%
        \rotatebox{90}{% 
            \resizebox{%
                \heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}% 
            {!}{\scshape\so\@chapapp}}\quad%
            \vspace*{-1cm}
        \raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
} 
\newcommand\feline@chm[1][4cm]{%
    \sbox\feline@chapter{\feline@chapter@marker[#1]}% 
    \makebox[0pt][c]{% aka \rlap
        \makebox[1cm][r]{\usebox\feline@chapter}%
    }}
\makechapterstyle{daleifmodif}{
    \renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so} 
    \renewcommand\chaptitlefont{\normalfont\Large\bfseries\scshape} 
    \renewcommand\chapternamenum{} \renewcommand\printchaptername{} 
    \renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par} 
    \renewcommand\afterchapternum{\par\vskip\midchapskip} 
    \renewcommand\printchaptertitle[1]{\color{gray}\chaptitlefont\raggedleft ##1\par}
} 
\makeatother 
\chapterstyle{daleifmodif}

我想要减少的距离的图片

答案1

添加设置\beforechapskip

\makechapterstyle{daleifmodif}{%
    \setlength{\beforechapskip}{0pt}% adjust to suit (the default is 50pt)
    \renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}%
    \renewcommand\chaptitlefont{\normalfont\Large\bfseries\scshape}%
    \renewcommand\chapternamenum{}%
    \renewcommand\printchaptername{} %
    \renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}%
    \renewcommand\afterchapternum{\par\vskip\midchapskip}%
    \renewcommand\printchaptertitle[1]{\color{gray}\chaptitlefont\raggedleft ##1\par}%
}

相关内容