|
|
Welcome to the TeXnik web site Header/Footer |
![]() |
||||||||||||||||||||||||||||||||||||||
|
Author-/Titlename in header |
Examples |
fancyheader |
letter class |
plain pagestyle for fancyhdr |
short headers |
Table in the header/footer |
Links:
Author-/Titlename in header
\let\oldAuthor\author
\renewcommand{\author}[1]{\newcommand{\myAuthor}{#1}\oldAuthor{#1}}
\let\oldTitle\title
\renewcommand{\title}[1]{\newcommand{\myTitle}{#1}\oldTitle{#1}}
%
% for example title on the left and author on the right (with package fanyhdr)
%
\lhead{\myTitle}
\rhead{\myAuthor}
plain style for fancyhdr
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[C]{\bfseries \thepage}
\renewcommand\headrulewidth{0pt}
\renewcommand\footrulewidth{0pt}
}
This gives a bold centered pagenumber.
Short Headers \chaptermark{My short Title}
or for a section
\sectionmark{myTitle}
Footer and header with fyncyhdr odd (right) pages: the contents of header and/or footer is set by: remember that there is a difference between the first pages of chapters, which are in plain-style and the other ones in fancy style: \fancyplain{plain_value}{normal_value}You can redefine the plain style in another way.
A header- and a footline are the defaults. No lines are given by the width 0pt. Example for special header and footer (\chaptermark is rewritten for twoside-option, where on the left page the chapter and on the right page the section are part of the header: \renewcommand{\chaptermark}[1]{% twoside and
\markboth{%
\ifnum \c@secnumdepth >\m@ne
\hfill\thechapter\quad \if @mainmatter
\@chapapp\ \thechapter\quad
\fi
\fi
#1%
}{%
\ifnum \c@secnumdepth >\m@ne
\if @mainmatter
\@chapapp\ \thechapter\quad
\fi
\fi
#1%
}%
}%
\renewcommand\sectionmark[1]{\markright{\thesection\ #1}}
\renewcommand\headrulewidth{0pt}
\renewcommand\footrulewidth{0pt}
% positioning
\usepackage{color}
\definecolor{myColor}{rgb}{0.9,0.9,0.9}
\fancyhead{}% delte the defaults
\fancyhead[RE,LO]{\bf\large\thepage} % right-even and left-odd
\fancyhead[LE]{\colorbox{myColor}{\parbox{0.9\columnwidth}{\leftmark}}} % even pages!
\fancyhead[RO]{\colorbox{myColor}{\parbox{0.9\columnwidth}{\rightmark}}} % odd pages!
\fancyfoot{} % clear
|
|||||||||||||||||||||||||||||||||||||||