오른쪽 여백 스위치에 회고록 행번호 장 번호가 있나요?

오른쪽 여백 스위치에 회고록 행번호 장 번호가 있나요?

회고록에 내장된 스타일과 관련하여 행넘 장 스타일을 오른쪽 정렬로 바꾸고 장 번호를 오른쪽 여백에 배치하는 간단한 명령이나 옵션이 있습니까? 나는 이를 달성하는 사용자 정의 스타일의 몇 가지 예를 보았지만 간단한 해결책을 기대합니다.

답변1

이는 수행할 수 있지만 간단한 명령이나 옵션으로는 수행할 수 없습니다. 새로운 장 스타일을 정의해야 합니다. 아래에는 invhangnum필수 사양이 포함된 장 스타일이 있습니다 .

\documentclass{memoir}
\usepackage{lipsum}% just to generate text for the example

\makechapterstyle{invhangnum}{%
  \setlength\beforechapskip{0pt}%
  \renewcommand*\chapterheadstart{\vspace{\beforechapskip}}%
  \setlength\afterchapskip{2\onelineskip plus .2\onelineskip minus 0.2\onelineskip}%  
  \renewcommand\chaptitlefont{\Huge\bfseries}
  \setlength\midchapskip{-\baselineskip}%
  \renewcommand\chapnumfont{\Huge\bfseries}
  \renewcommand*{\printchaptername}{}
  \renewcommand*{\chapternamenum}{}
  \renewcommand*{\printchapternum}{%
      \raisebox{\dimexpr\midchapskip+\baselineskip\relax}[0pt][0pt]{%
        \makebox[0pt][l]{%
        \makebox[\dimexpr\textwidth+4em\relax][l]{%
          \parbox[t]{\textwidth}{\mbox{}}%
          \parbox[t]{4em}{\hfill\chapnumfont \thechapter}}}}}%
  \renewcommand*{\printchaptertitle}[1]{%
    \raisebox{\dimexpr\midchapskip+\baselineskip\relax}[0pt][0pt]{%
      \parbox[t]{\textwidth}{\raggedright\chaptitlefont ##1}}}%
}
\chapterstyle{invhangnum}

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

여기에 이미지 설명을 입력하세요

관련 정보