Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 5 down vote accepted

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}
share|improve this answer
    
Awesome! It works! Thanks so much. –  Tom de Bruin Feb 2 '12 at 10:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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