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}

ここに画像の説明を入力してください

関連情報