使用 veelo 风格的回忆录时,将章节编号与章节名称右对齐

使用 veelo 风格的回忆录时,将章节编号与章节名称右对齐

我正在使用memoir 文档类和veelo章节样式。我无法将章节号向右对齐,因此它具有与节名相同的右边距。由于页边距,章节号右侧的黑色矩形不会出现。我使用的部分代码:

\documentclass[a4paper,12pt,twoside]{memoir}
\chapterstyle{veelo}
\settypeblocksize{252mm}{165mm}{*} 
\setlrmarginsandblock{25mm}{20mm}{*} 
\setulmarginsandblock{20mm}{25mm}{*} 
...
\chapter{Introduction}

当我编译时,我得到了下图左侧的内容,并且我想要获得右侧的内容。

章节样式图像

谢谢。

答案1

不幸的是,您没有提供关于标题相对于文本的水平位置的信息;这里有一个可以实现您想要的新样式的可能定义:

\documentclass[a4paper,12pt,twoside]{memoir}
\usepackage{graphicx}
\usepackage{lipsum}

\settypeblocksize{252mm}{165mm}{*} 
\setlrmarginsandblock{25mm}{20mm}{*} 
\setulmarginsandblock{20mm}{25mm}{*} 

\makeatletter
\newlength{\numberheight}
\setlength{\numberheight}{\beforechapskip}

\newlength{\barlength}
\makechapterstyle{myveelo}{%
\setlength{\afterchapskip}{40pt}
\renewcommand*{\chapterheadstart}{\vspace*{40pt}}
\renewcommand*{\afterchapternum}{\par\nobreak\vskip 25pt}
\renewcommand*{\chapnamefont}{\normalfont\LARGE\flushright}
\renewcommand*{\chapnumfont}{\normalfont\HUGE}
\renewcommand*{\chaptitlefont}{\normalfont\HUGE\bfseries\flushright}
\renewcommand*{\printchaptername}{%
\chapnamefont\MakeUppercase{\@chapapp}\hspace*{\midchapskip}}
\renewcommand*{\chapternamenum}{}
\setlength{\beforechapskip}{18mm}
\setlength{\midchapskip}{\paperwidth}
\addtolength{\midchapskip}{-\textwidth}
\addtolength{\midchapskip}{-\spinemargin}
\addtolength{\midchapskip}{-2.5em}
\renewcommand*{\printchapternum}{%
\makebox[0pt][l]{\hspace{-\midchapskip}%
\resizebox{!}{\numberheight}{\chapnumfont \thechapter}%
\hspace{.8em}%
\rule{\midchapskip}{\beforechapskip}%
}}%
\makeoddfoot{plain}{}{}{\thepage}}
\makeatother
\chapterstyle{myveelo}

\begin{document}
\chapter{Introduction}
\lipsum[2]
\end{document}

在此处输入图片描述

相关内容