Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

WIth fancyhdr, one must use the package extramarks to get the headers of the subsections right; but for the old hack:

\markboth{WEWFE}{ONWOOQ}

no longer works. For the section headers I use \firstleftmark and the last version.

My setting is:

\documentclass[a4paper, 11pt]{article}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{extramarks}
\pagestyle{fancy}
%
\fancyhf{}
\fancyfoot{}
\renewcommand{\sectionmark}[1]{\markboth{\thesection\ {#1}}{}}
\renewcommand{\subsectionmark}[1]{\markright{\thesubsection\ {#1}}}
\fancyhead[L]{\nouppercase{\firstleftmark}}
\fancyhead[C]{\nouppercase{\lastrightmark}}
%   
\begin{document}
\tableofcontents
%
\section{first section}
%
\lipsum[1]
%
\subsection{first subsection}
%
\lipsum[1]
%
\end{document}

The problem is that table of content is printed as a subsection [so in the middle of the header] not as a section [it should be on the left of the header]

I want precisely the converse, because the ToC is considered as actually a section, not a subsection!

share|improve this question
    
Your code is not complete and does not compile. –  karlkoeller Sep 11 '13 at 4:52
    
@paul Added the lines of code necessary to compile, but from the PDF I see that the contents is printed on the left and not in the middle. –  Andrea L. Sep 11 '13 at 6:23

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.