我想將章節標題及其上方的規則向左擴展,因此在文字區塊後面的值是 -0.75。
微量元素:
\documentclass[oneside,12pt]{memoir}
\usepackage{graphicx}
\begin{document}
\chapterstyle{madsen}
\frontmatter
\tableofcontents
\mainmatter
\chapter{First chapter}
Text
\chapter{Second chapter}
More text
\end{document}
答案1
在以下範例中,我定義了mymadsen
具有所需規範的章節樣式:
\documentclass{memoir}
\usepackage{graphicx}
\usepackage{lipsum}
\makechapterstyle{mymadsen}{%
\chapterstyle{default}
\renewcommand*{\chapnamefont}{%
\normalfont\large\scshape\raggedleft}
\renewcommand*{\chaptitlefont}{%
\normalfont\Huge\bfseries\sffamily\raggedleft}
\renewcommand*{\chapternamenum}{}
\setlength{\chapindent}{0.75in}
\renewcommand*{\printchapternum}{%
\makebox[0pt][l]{\hspace{0.4em}%
\resizebox{!}{4ex}{%
\chapnamefont\bfseries\sffamily\thechapter}%
}%
}%
\renewcommand*{\printchapternonum}{%
\chapnamefont \phantom{\printchaptername \chapternamenum%
\makebox[0pt][l]{\hspace{0.4em}%
\resizebox{!}{4ex}{%
\chapnamefont\bfseries\sffamily 10}%
}%
}%
}%
\setlength\midchapskip{1ex}
\renewcommand*{\printchaptertitle}[1]{%
\begin{adjustwidth}{-\chapindent}{}
\par\hrulefill\vskip\midchapskip
\raggedleft \chaptitlefont ##1\par\nobreak
\end{adjustwidth}}
}
\chapterstyle{mymadsen}
\begin{document}
\chapter*{Test unnumbered chapter and some textv}
\lipsum[4]
\chapter{Test numbered chapter and some textviiii}
\lipsum[4]
\end{document}
未編號章節的圖片:
一個用於編號的章節: