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 use memoir class and got some problems with ToC. Chapter style defined as:

\font\robotoLarge="name:Roboto:protrusion=default;expansion=default;tlig;trep" at 24pt

\makechapterstyle{general}{
\renewcommand*{\chapterheadstart}{\vskip 30mm}
\renewcommand*{\printchaptername}{}
\renewcommand*{\printchapternum}{}
\renewcommand*{\printchaptertitle}[1]{\hspace*{16mm}\robotoLarge{}##1\rule[-1ex]{0pt}{1ex}}
\renewcommand*{\afterchaptertitle}{\hrule height 0.5mm\vskip 40pt}}\chapterstyle{general}

But when ToC is created, the chapter style is defferent: the font is smaller, the \hrule has no space before and sticks to letters. How can the style of ToC be fixed to be the same as my main chapterstyle?

share|improve this question
1  
Welcome to TeX.SE! It would help if you posted a MWE (minimum working example), rather than some code snippets, that generates the problem behavior you're trying to get rid of. –  Mico Mar 19 '12 at 13:30
    
You should use fontspec facilities for defining the "Roboto" font for usage in your document, not resorting to the \font primitive. –  egreg Mar 19 '12 at 13:42
    
egreg, thanks. I will rewrite the code to use fontspec. –  SadChi Mar 20 '12 at 6:35

1 Answer 1

up vote 5 down vote accepted

The toc title is typeset using the part of the chapter style which is suitable for un-numbered pages. People often forget to add this part, see \printchapternonum. Also remember that the un-numbered part never issues \afterchapternum so it may be an idea to add this to \printafternonum (which is empty by default).

Since I have no idea what that font is about, please post a minimal example, and which engine you are using. This test using palatino, does not seem to have any differences between numbered and un numbered:

\documentclass[a4paper]{memoir}
\usepackage[T1]{fontenc}
\def\robotoLarge{\renewcommand{\rmdefault}{ppl}\fontsize{24pt}{30pt}\bfseries}

\makechapterstyle{general}{
\renewcommand*{\chapterheadstart}{\vskip 30mm}
\renewcommand*{\printchaptername}{}
\renewcommand*{\printchapternum}{}
\renewcommand*{\printchaptertitle}[1]{\hspace*{16mm}\robotoLarge{}##1\rule[-1ex]{0pt}{1ex}}
 \renewcommand*{\afterchaptertitle}{\hrule height 0.5mm\vskip 40pt}}
\chapterstyle{general}
\begin{document}
\tableofcontents*
%\chapter*{This is a test}
\chapter{This is a test}
\end{document}
share|improve this answer
    
Thanks! fontspec and \printafternonum make everything working as it should. –  SadChi Mar 20 '12 at 6:36

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.