.png)
veelo 챕터 스타일을 수정하는 데 몇 가지 문제가 있습니다. 여백이 작기 때문에(A5 용지 크기가 필요함) 일반 veelo가 제대로 작동하지 않았습니다. 따라서 여백에 장 번호를 표시하는 대신 텍스트 블록에 오른쪽 정렬되도록 하고 싶습니다(그림 참조). 지금은 하드 코딩하여 그렇게 하고 있지만 다양한 숫자 문자의 너비가 다르기 때문에 모든 장에서 일관되게 작동하지는 않습니다. 또한 트림 표시 외부로 확장된 검은색 상자는 숫자에 왼쪽 정렬되어 상자의 크기가 장 번호에 따라 달라집니다.
내 질문: 아래 코드를 확인하고 1) 텍스트 블록에 숫자를 오른쪽 정렬하고 2) 숫자 너비에 관계없이 블랙 박스의 크기를 동일하게 만드는 것으로 변경해야 할 사항을 알려주실 수 있습니까?
정말 고마워!
\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}{-11.5em}
\renewcommand*{\printchapternum}{%
\makebox[0pt][l]{\hspace{-1.5cm}%
\resizebox{!}{\numberheight}{\chapnumfont \thechapter}%
\hspace{1.8em}%
\rule{\midchapskip}{\beforechapskip}%
}}%
\makeoddfoot{plain}{}{}{\thepage}}
\makeatother
답변1
재정의는 \printchapternum
다음과 같이 변경되어야합니다
\renewcommand*{\printchapternum}{%
\enspace\resizebox{!}{\numberheight}{\chapnumfont\thechapter}%
\rlap{\hspace{1cm}\rule{\midchapskip}{\beforechapskip}}%
}%
1cm
숫자와 채워진 사각형을 분리하는 데 사용한 I를 원하는 값으로 변경합니다 .
전체 코드:
\documentclass{memoir}
\usepackage{graphicx}
\makeatletter
\newlength{\numberheight}
\setlength{\numberheight}{\beforechapskip}
\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}}
\renewcommand*{\chapternamenum}{}
\setlength{\beforechapskip}{18mm}
\setlength{\midchapskip}{\paperwidth}
\addtolength{\midchapskip}{-\textwidth}
\addtolength{\midchapskip}{-\spinemargin}
\addtolength{\midchapskip}{-11.5em}
\renewcommand*{\printchapternum}{%
\enspace\resizebox{!}{\numberheight}{\chapnumfont\thechapter}%
\rlap{\hspace{1cm}\rule{\midchapskip}{\beforechapskip}}%
}%
\makeoddfoot{plain}{}{}{\thepage}%
}
\chapterstyle{myveelo}
\makeatother
\begin{document}
\chapter{Test chapter}
\setcounter{chapter}{100}
\chapter{Test chapter}
\end{document}
출력 이미지: