4
votes

I have a document where I want to place an unnumbered section in my header. I use the fancyhdr package, and for a numbered section, I would had done something like this:

\lhead{\leftmark}

But this don't work with unnumbered sections. I'm solving math-problems in my document, so I don't want part-sections and numbered sections

Anyone, who knows, how this is done?

2

2 Answers

6
votes

Use

      \chapter*{Preface\markboth{Preface}{}}

for your unnumbered section. (You should replace chapter with whatever you are actually using.)

You can even try

\newcommand{\mysection}[1]{\section*{{#1}\protect\markboth{#1}{}}}

but be careful -- it may create some problems with TOC or references.

1
votes

Is there anything wrong with

\section*{}
\subsection*{}
\subsubsection*{}