TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using LyX and would like (all) my document pages to have a fancy header style that I defined. However, including




doesn't work! The only way I got it to work is using the ERT command


at the beginning of the document. Does anyone know how to get over it without using an ERT?

share|improve this question
up vote 3 down vote accepted

\thispagestyle only pertains to the page that you're calling it on. To make all the pages have the fancy style, you need to use \pagestyle{fancy}. In LyX, it is possible to set this via Document->Settings... and choosing the "Page Layout" tab with the "Heading style" as fancy:

enter image description here

Note that the standard document classes that contains \chapter (book or report) will still use \thispagestyle{plain} for the first page of every \chapter (this includes title pages, as well as ToC-related first-pages as well, since the latter is issued using \chapter*). To avoid this, you have to issue an explicit \thispagestyle{fancy} in an ERT after the chapter title.

share|improve this answer
Thanks. I just figured that my problem arises because of having a title (a simple title, not a title page.) So my only option is to use an ERT? – Elec Feb 19 '12 at 7:17
@Elec: No, you could add content in your preamble as well. For example, \makeatletter\let\ps@plain\ps@fancy\makeatother would overwrite the plain page style with that of fancy, making any call to \..pagestyle{plain} be equivalent to \..pagestyle{fancy}. However, such generalizations should be considered carefully, since it may result in headers displaying on pages where headers might look weird (like the first page of a chapter). – Werner Feb 19 '12 at 7:25
I see. Thanks. It seems like a big bug though, that fancy style cannot be implemented after a title (with usual LyX options)... – Elec Feb 19 '12 at 7:57
Does this work with IEEE Transactions Document class? – zygimantus Dec 1 '15 at 21:18
@zygimantus: Yes... until proven otherwise. However, don't fiddle around with journal-specific document class layouts if you plan on submitting it. – Werner Dec 1 '15 at 21:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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