\renewcommand*\sectionmark[1]{\markboth{\MakeUppercase{#1}}{}}
Stefan
\renewcommand*\sectionmark[1]{\markboth{\MakeUppercase{#1}}{}}
Wie gesagt: Es ist keine gute Idee das so zu machen. Wenn man \thesection direkt in den Kopf packt, statt das über den Mark-Mechanismus zu machen, dann kann die falsche Angabe im Kopf landen. Das ist gar nicht schwer zu erreichen:Stefan hat geschrieben:Bei obigem Codebeispiel ginge etwaDas muss nach \pagestyle{fancy}[/i] stehen.\renewcommand*\sectionmark[1]{\markboth{\MakeUppercase{#1}}{}}
\documentclass[12pt]{paper} \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{colortbl} \usepackage{color} \definecolor{darkblue}{rgb}{0,0,0.5} \rhead{\color{black}Seite \thepage} \lhead{\begin{tabular}{>{\columncolor{darkblue}\color{white}}c|||% >{\columncolor{white}}c} \large\bfseries~~\thesection&~ \end{tabular}\color{darkblue}\bfseries\leftmark} \renewcommand*\sectionmark[1]{\markboth{\MakeUppercase{#1}}{}} \usepackage{lipsum} \begin{document} \section{First Section} \lipsum[2-4]\lipsum[4] \section{Second Section} \lipsum \end{document}
\documentclass[12pt]{paper} \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{colortbl} \usepackage{color} \definecolor{darkblue}{rgb}{0,0,0.5} \rhead{\color{black}Seite \thepage} \DeclareRobustCommand*{\sectionmarkbox}[1]{% \begin{tabular}{>{\columncolor{darkblue}\color{white}}c|||% >{\columncolor{white}}c} \large\bfseries~~#1&~ \end{tabular} } \newcommand{\sectionmarkformat}{% \sectionmarkbox{\thesection}% } \lhead{\color{darkblue}\bfseries\leftmark} \renewcommand*\sectionmark[1]{\markboth{\sectionmarkformat\MakeUppercase{#1}}{}} \usepackage{lipsum} \begin{document} \section{First Section} \lipsum[2-4]\lipsum[4] \section{Second Section} \lipsum \end{document}
Ich nicht:astf hat geschrieben:Aber ich bekomme auch bei der \DeclareRobustCommand* - Variante auf der ersten Seite schon Second Section in der Kopfzeiel angezeigt.
*File List* paper.cls 2008/05/30 1.0l LaTeX document class (wm). size12.clo 2005/09/16 v1.4f Standard LaTeX file (size option) fancyhdr.sty colortbl.sty 2001/02/13 v0.1j Color table columns (DPC) array.sty 2005/08/23 v2.4b Tabular extension package (FMi) color.sty 2005/11/14 v1.0j Standard LaTeX Color (DPC) color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive pdftex.def 2008/09/08 v0.04l Graphics/color for pdfTeX lipsum.sty 2005/01/26 v1.0 150 paragraphs of Lorem Ipsum dummy text supp-pdf.tex ***********