*enter image description here*

Please guide me, what should i used instead of this code, so that the current section name will be displayed instead of the chapter name as a left side of the header in the page. Thank you.

  • 3
    Welcome to TeX.SX! Instead of posting a screenshot of code it's better to show some of your code such that users can start immediately
    – user31729
    Sep 21 '15 at 16:39

You have to use \rightmark instead of \leftmark in your \rhead declaration. \rightmark contains the section info, while \leftmark is for the chapter:









testpage 1
testpage 2


Note that I used \fancyhead instead of \lhead and \rhead. It does the same, but you don't have to repeat everything.

  • Please, remove \rm and change it into \normalfont. Note that \rm has been deprecated for 20 years. Also \sl should be \slshape.
    – egreg
    Sep 21 '15 at 17:31
  • @egreg Done. I didn't think too much about the font style, just copied. \rm being deprecated is a good reason why I didn't know it :)
    – cauchy42
    Sep 21 '15 at 17:36

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.