# Problem with fancyhdr

I use package fancyhdr for make header and footer.

I want to auto quote text in the chapter for right header.

I use : \rhead{\thechapter} when latex show for me the number of chapter not text.

Can you tell me : How to show text of chapter on the right header(auto) ? Thanks for hint .

Now i have a new problems , if chapter name is very long , i want to have two line in header?

You have to handle with \leftmark and \righmark. The example shows you one way. For more information you should read the manual of fancyhdr: http://ctan.org/pkg/fancyhdr

\documentclass{book}
\usepackage{fancyhdr}

• @user41499: Rather than doing that, you should use the optional argument of \chapter to specify a shorter/compact version of the title: \chapter[<short title>]{<long title>} Nov 24 '13 at 17:54
• @user41499: You can use a \parbox inside: \rhead{\parbox{\linewidth}{\leftmark}}`. However you have to recompute the margins. Nov 24 '13 at 18:00