[Tex/LaTex] Using \@author variable to put authors name in fancy header

footnotesheader-footertitles

I'm using \@author variable to put authorname in header of my document. Currently, header shows authorname and footnotemark which incerements every page:

\makeatletter
\let\runauthor\@author
\let\runtitle\@title
\makeatother

\fancyhead[OC]{\runauthor}
\fancyhead[EC]{\sc \runtitle}

For example, if author is John Doe, I get printed

John Doe^1 (1.page)
John Doe^2 (2.page)
...
etc.

Any ideas ?

Best Answer

This works fluently.

\documentclass[twoside]{article}

\usepackage{fancyhdr}
\usepackage{authoraftertitle}

\makeatletter
\fancyhead[OC]{{\let\thanks\@gobble\MyAuthor}}
\fancyhead[EC]{\scshape \MyTitle}
\pagestyle{fancy}
\makeatother

\title{TTT}
\author{AAA\thanks{THXTHX}}

\usepackage{lipsum} % filler text

\begin{document}

\maketitle
\lipsum[1-40]

\end{document}