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.

  • 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 '16 at 21:25
  • What is \so supposed to do? – cfr Jan 29 '16 at 23:59
  • \so is defined neither by the LaTeX kernel nor by memoir. – egreg Jan 30 '16 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 '16 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 '16 at 0:01
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

|improve this answer|||||
  • Hi Enrico. How are you doing? No unsung hero badge sorry. :) – user11232 Jan 30 '16 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.