使用 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}

在此輸入影像描述

相關內容