to compile my thesis, I had to move my settings for the fancy header into a separate file (command.tex). So I copied all the corresponding tex in this file like this:
Code: Select all
\newcommand{\makefancyheader}[1]{
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{} % delete current header and footer
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt} % space for the rule
\fancypagestyle{plain}{\fancyhead{} % get rid of headers on plain pages
\renewcommand{\headrulewidth}{0pt} % and the line
}
\setlength{\headheight}{15pt}
}
Code: Select all
\include{command}
\makefancyheader
The compilation stops at the first chapter with this error:
Code: Select all
(D:/chapter01.tex
Chapter 1.
Runaway argument?
{
! Paragraph ended before \markboth was complete.
<to be read again>
\par
l.1 \chapter{Introduction}
? h
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
thank you