renewcommand chapter

Just a short question: I want to renew the chapter command, so that I can manipulate the distance between the chapter number and the chapter title in my header, currently I have defined my header as:

\renewcommand{\chaptername}{}


now I want to change the chaptermark/chaptername, so that I can manipulate the distance between the number and the title.

E.g. currently it says 1. INTRODUCTION but I want the space between 1. and INTRODUCTION to increase?

I know this is not a working example, but I hope you get it fast what I mean.

-
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Jubobs Mar 5 '13 at 14:56

KOMA-Script

It is quite easy with the KOMA-Script classes. There macro \chaptermarkformat sets the chapter number in the headings and can be redefined, e.g.:

\documentclass{scrbook}

\makeatletter
\makeatother

\begin{document}
\chapter{First chapter}
\newpage
Some text.
\end{document}


(\g@addto@macro{\cmd}{stuff} appends stuff to parameterless macro cmd).

Package fancyhdr

With package fancyhdr or the standard classes the distance is hardcoded in \chaptermark that is defined in the page style command. Therefore it becomes uglier, because also the page style command needs to be redefined, e.g.:

\documentclass{book}

\usepackage{fancyhdr}

\newlength{\marknumsep}

\makeatletter
\def\ps@fancy{%
\@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%
\@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}%
\@ifundefined{chapter}{%
\def\sectionmark##1{%
\markboth{%
\MakeUppercase{%
\ifnum \c@secnumdepth>\z@
% \thesection\hskip 1em\relax % ORIGNAL
\thesection\hskip\marknumsep % NEW
\fi
##1%
}%
}{}%
}%
\def\subsectionmark##1{%
\markright{%
\ifnum \c@secnumdepth >\@ne
% \thesubsection\hskip 1em\relax % ORIGINAL
\thesubsection\hskip\marknumsep % NEW
\fi
##1%
}%
}%
}{%
\def\chaptermark##1{%
\markboth{%
\MakeUppercase{%
\ifnum \c@secnumdepth>\m@ne
% \@chapapp\ \thechapter. \ % ORIGINAL
\thechapter\hskip\marknumsep % NEW
\fi
##1%
}%
}{}%
}%
\def\sectionmark##1{%
\markright{%
\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
% \thesection. \ % ORIGINAL
\thesection.\hskip\marknumsep % NEW
\fi
##1%
}%
}%
}%
}%
\ps@@fancy
\gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}%
\fi
}
\makeatother

\pagestyle{fancy}

\begin{document}
\chapter{First chapter}
\newpage
Some text.
\end{document}


Now the distance between number and text in the headings can be controlled by the length \marknumsep. Also the example has removed the "Chapter"/"Appendix" prefix (\@chapapp).

-