祝大家圣诞快乐。我正在尝试制作一个 LyX 模板,因为我必须在接下来的 12 个月内撰写三份报告。我正在使用 memoir 和 chapterstyle demo2。我该怎么做
1)右对齐章节号(名称已经右对齐)和
2)将其从“一”更改为“第 1 章”?
3) 我可以对我的附录做同样的事情吗?即右对齐并以“附录 A”而不是“A”开头?
这是我目前的序言:
\chapterstyle{demo2}
\makepagestyle{mystyle}
\makeheadrule {mystyle}{\textwidth}{\normalrulethickness}
\makeevenhead{mystyle}{\small\leftmark}{}{}
\makeoddhead{mystyle}{\small\rightmark}{}{}
\makeevenfoot{mystyle}{}{\thepage }{}
\makeoddfoot{mystyle}{}{\thepage}{}
答案1
定义章节样式的变体demo2
:
\documentclass{memoir}
\makeatletter
\makechapterstyle{demo2var}{%
\chapterstyle{default}
\renewcommand*{\chaptitlefont}{\normalfont\Huge\sffamily}
\renewcommand*{\chapnumfont}{\chaptitlefont}
\renewcommand*{\printchaptername}{\raggedleft}
\renewcommand*{\printchapternum}{\chapnumfont
\ifanappendix Appendix \else Chapter \fi\thechapter}
\renewcommand*{\printchaptertitle}[1]{%
\hrule\vskip\onelineskip \raggedleft \chaptitlefont ##1}
\renewcommand*{\afterchaptertitle}{%
\vskip\onelineskip \hrule\vskip \afterchapskip}
\setlength{\beforechapskip}{3\baselineskip}
\renewcommand*{\printchapternonum}{%
\vphantom{\chapnumfont One}
\afterchapternum%
\vskip\topskip}
\setlength{\beforechapskip}{2\onelineskip}}
\makeatother
\chapterstyle{demo2var}
%% add here the changes for headers and footers
\begin{document}
\mainmatter
\chapter{Fundamentals}
\appendix
\chapter{Minor points}
\end{document}