[OS X TeX] fancyhdr question

Christopher Menzel cmenzel at tamu.edu
Fri Oct 14 16:45:56 CEST 2011

On Oct 14, 2011, at 1:52 PM, Luis Sequeira wrote:
>> Greetings,
>> I am using the article documentclass and the following header formatting:
>> \usepackage{fancyhdr}
>> \pagestyle{fancy}
>> \lhead{\smaller\nouppercase{\textsc{\leftmark}}}
>> \chead{}
>> \rhead{\smaller\nouppercase{\textit{\rightmark}}}
>> \lfoot{}
>> \cfoot{\smaller\thepage}
>> \rfoot{}
>> The documentation for fancyhdr points out that if one wants both the current section (\leftmark) and subsection (\rightmark) to appear in one's header (and the code above shows that I do), on the first page of a new section the \rightmark will be empty and hence the subsection, even though it appears on that page, will not show up in the header for that page.  The documentation then notes:
>> If this is a problem you must manually insert extra \markright 
>> commands or redefine the ... \sectionmark command to issue a
>> \markboth command with two decent parameters.
>> Alas, although it looks like it would be easy for a TeX whiz, I have no idea how to implement these solutions.  I have spent a good bit of time trying to hunt more concrete code on the web, to no avail.  A relevant URL or a code snippet would be most appreciated.
>> Chris Menzel
> I tried a small example with a section and a subsection starting in the first page of that section and the title of the subsection DOES APPEAR on the right - so apparently your problem has already been solved (probably the documentation is older than the implementation and the author of fancyhdr has solved the problem for you already :-)).

Well, except that I am actually having the problem (with MacTeX 2011) not simply reading about it. :-) Perhaps there is a conflict with one of the other packages I'm using that you didn't use in your test. But thanks very much for the report, that gives me hope for a simpler solution!

> [By the way, the only change I had to make was because \smaller was unrecognized - perhaps you meant \small instead?]

No, Herb rightly surmised that I was using the relsize package (removing which, alas, did not solve my problem, but I am using other packages as well that I'll try eliminating).

Chris Menzel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/macostex-archives/attachments/20111014/82c0a951/attachment.html>

More information about the macostex-archives mailing list