I am working on my dissertation using xelatex and the memoir class. Many of the titles to my chapters contain long words which I don't want to be hypenated in the table of contents.

According the memoir class user guide, I should be able to use this command to achieve this: \renewcommand{\@tocrmarg}{2.55em plus1fil} This used to work, but now with more updated versions of tex it no longer works.

I always had this command in the preamble, but now it throws an error (Missing \begin{document}). Moving it to after \begin{document} does not solve this.

I realise that I could just manually add newlines to the chapter titles, but as I generate the titles with a command, this is not really useful.

I really just want to get the @tocrmarg command redefinition working ...

Who can help? I have attached a minimal example below (with the \renewcommand commented out):

\documentclass[11pt,oneside]{memoir}
\renewcommand{\@tocrmarg}{2.55em plus1fil}
\begin{document}
\tableofcontents

\newcommand{\lw}{Thisisalongwordverylong}

\chapter{\lw\ \lw\ \lw}

\end{document}

-

You have to deal with the @-sign in the command name. TeX does not recognize it as a part of the name. To solve it, enclose the whole \renewcommand to \makeatletter...\makeatother:

\documentclass[11pt,oneside]{memoir}
\makeatletter %% HERE
\renewcommand{\@tocrmarg}{2.55em plus1fil}
\makeatother %% AND HERE
\begin{document}
\tableofcontents

\newcommand{\lw}{Thisisalongwordverylong}

\chapter{\lw\ \lw\ \lw}

\end{document}

-
Awesome! It works! Thanks so much. –  Tom de Bruin Feb 2 '12 at 10:06