我为回忆录定义了一个章节风格,如下:
\documentclass[10pt]
{memoir}
\let\STARTCODE\relax
\let\STOPCODE\relax
\STARTCODE
\usepackage{color}
\definecolor{nicered}{rgb}{.647,.129,.149}
\makechapterstyle{mym}{
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
\renewcommand\chaptitlefont{\normalfont\Huge\bfseries\scshape \color{nicered}}
\renewcommand\printchapternonum{}
\renewcommand\printchaptertitle[1]{\chaptitlefont ##1}
\renewcommand\afterchaptertitle{\par\nobreak\bigskip\hrule\vskip0.5in}
}
\STOPCODE
\setlength\afterchapskip {\onelineskip }
\setlength\beforechapskip {\onelineskip }
\usepackage{lipsum}
\chapterstyle{mym}
\begin{document}
\chapter{Chapter 1}
\lipsum
\end{document}
当我通过 latex 运行它时,我收到错误消息
! Undefined control sequence.
\chapnamefont ... \Large \scshape \raggedleft \so
l.33 \chapter{Chapter 1}
The control sequence at the end of the top line
of your error message was never \def'ed.
但此后一切都按预期进行。我试图通过阅读 memman.pdf 找出问题所在,但这很吓人。
答案1
该宏\so
由 定义soul
;但有一个更好的方法可以获得“字母空格”效果,即microtype
:
\documentclass{memoir}
\usepackage{microtype}
\usepackage{color}
\definecolor{nicered}{rgb}{.647,.129,.149}
\makechapterstyle{mym}{%
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\lsstyle}%
\renewcommand\chaptitlefont{\normalfont\Huge\scshape\color{nicered}\lsstyle}%
\renewcommand\printchapternonum{}%
\renewcommand\printchaptertitle[1]{\chaptitlefont ##1}%
\renewcommand\afterchaptertitle{\par\nobreak\bigskip\hrule\vspace{0.5in}}
}
\setlength\afterchapskip{\onelineskip}
\setlength\beforechapskip{\onelineskip}
\usepackage{lipsum}
\chapterstyle{mym}
\begin{document}
\chapter{Test}
\lipsum
\end{document}
我修复了代码中的其他一些小问题。主要修正是删除\bfseries
。只有少数字体有粗体小写字母,但无论如何这都太多了:您已经有了\Huge
颜色。