答案1
尝试此代码(第一个问题)。
\documentclass[12pt,a4paper]{memoir}
\usepackage{xcolor,calc,graphicx,soul,fourier}
\usepackage{showframe}% only to show the margins <<<<<<
\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{black}{\color{white}\sffamily\thechapter}%
}}%
\rotatebox{90}{%
\resizebox{%
\heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
{!}{\scshape\so\@chapapp}}\quad%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][l]{% aka \rlap
\makebox[1cm][l]{\usebox\feline@chapter}% changed <<<<
}}
\makechapterstyle{daleifmodif}{%
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
\renewcommand\chaptitlefont{\normalfont\Large\bfseries\scshape\color{black}}
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{\feline@chm[2.5cm]\hfill\par} % changed <<<<
\renewcommand\afterchapternum{\par\vskip\midchapskip}
\renewcommand\printchaptertitle[1]{\chaptitlefont\raggedright ##1\par}% changed <<<<
}
\makeatother
\chapterstyle{daleifmodif}
\begin{document}
\setcounter{chapter}{3}
\chapter{Materials and Methods}
\end{document}