I realize I have asked almost the same question earlier.
There, the answer involved xparse or titlesec. Titlesec however gets into conflicts with memoir's pagestyles (running header settings, \leftmark and so on), and a new command \Section with xparse bypasses the useful mechanisms of memoir for the default \section.
I tend to think it shouldn't be too difficult use memoir's \setsecheadstyle, but somehow I'm not getting the command definition right.
So I'm trying to add soul letterspacing to the \section formatting in a
memoir document. The docs recommend \setsecheadstyle.
\newcommand\sectionFmt[1]{%
\MakeUppercase{\soSection{#1}}%
}
\setsecheadstyle{\sectionFmt}
It errors out with ! A <box> was supposed to be here. However,
\textit{#1} works fine.
It seems I'm just not passing the argument properly. How to do this right?
MWE:
\documentclass{memoir}
\makeatletter
\usepackage{soul}
\sodef\soSection{}{.1em}{.5em plus.1em}{.1em plus.1em minus.1em}
\newcommand\sectionFmt[1]{%
% This errors out with: '! A <box> was supposed to be here.'
\MakeUppercase{\soSection{#1}}%
% But \textit{} works.
%\MakeUppercase{\textit{#1}}%
}
\setsecheadstyle{\sectionFmt}
\makeatother
\begin{document}
And most conclusive of all, there are the two hideous results which the doctor
obtained from a certain pair of formulae during his final investigations.
\section{Monstrous Implications}
Results which virtually proved the authenticity of the papers and of their
monstrous implications at the same time that those papers were borne forever
from human knowledge.
-- The Case of Charles Dexter Ward, H.P. Lovecraft
\end{document}
souldoes not handle that very well. Try just letting\sectionFmtreturn the input unaltered plus type it to the log via\typeout{#1}, then you will see the difference. Perhapsmicrotypemight help better (untested). – daleif Mar 28 '14 at 09:35