TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


How to define a header/footer style using \fancypagestyle ?

Minimal Code (does not work)




\renewcommand{\chaptermark}[1]{\markboth{\small\tt\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\small\sf\thesection\ #1}}




share|improve this question
up vote 2 down vote accepted

Redefine \chaptermark and \sectionmark after choosing \pagestyle{ttt}. Also, did you read this answer?

EDIT: Sorry for being snippy - you may have read my other answer before I edited it.

share|improve this answer
thanks for your answer. I already read your prev post. Good! – xport Jan 17 '11 at 13:02

Your problem is that inside \fancypagestyle{foo}{<stuff>}, redefining macros that take numbered arguments need to have their #s "escaped" like this:

  \renewcommand{\chaptermark}[1]{\markboth{\small\tt\chaptername\ \thechapter.\ ##1}{}}%
  \renewcommand{\sectionmark}[1]{\markright{\small\sf\thesection\ ##1}}%
share|improve this answer

Your Answer


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.