3

I defined a chapter style for memoir as follows:

\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}

when I run this through latex I get an error message

! 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.

but thereaftere everything works as intended. I tried to figure out what's wrong by reading memman.pdf, but it is intimidating.

6
  • Welcome to TeX.SX! Apart from an error due to the misplaced \afterchapskip in \afterchaptertitle, I have no problem with \chapter. Can you make a complete example showing the issue?
    – egreg
    Jan 29, 2016 at 21:25
  • What is \so supposed to do?
    – cfr
    Jan 29, 2016 at 23:59
  • \so is defined neither by the LaTeX kernel nor by memoir.
    – egreg
    Jan 30, 2016 at 0:00
  • @egreg: I edited it to be a complete example. The error message is from the log file. In the console it flags \chapter as the undefined control sequence.
    – gcc
    Jan 30, 2016 at 0:00
  • No it is saying that \so is undefined. The last command on that line, it complains of. The control sequence at the end of the top line...
    – cfr
    Jan 30, 2016 at 0:01

1 Answer 1

3

The macro \so is defined by soul; but there's a better method for obtaining the “letter space” effect, with 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}

I've fixed some other glitches in the code. The main correction is removing \bfseries. Only a few fonts have boldface small caps, but in any case this would be too much: you already have \Huge and color.

enter image description here

1
  • Hi Enrico. How are you doing? No unsung hero badge sorry. :)
    – user11232
    Jan 30, 2016 at 1:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .