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

  • chapter name is too long , i want to break line on header? Can you help me?
    – user41499
    Nov 24 '13 at 17:48
  • 1
    @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>}
    – Werner
    Nov 24 '13 at 17:54
  • @werner I see but i have to do it because that ruler.Thanks werner
    – user41499
    Nov 24 '13 at 17:58
  • @user41499: You can use a \parbox inside: \rhead{\parbox{\linewidth}{\leftmark}}`. However you have to recompute the margins. Nov 24 '13 at 18:00
  • I try , before i try to use package calc for auto computes but not win.
    – user41499
    Nov 24 '13 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.