I've copied a code to have a header that prints the section name on the left and my name on the right:
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\rhead{\fancyplain{}{MyName}}
\lhead{\fancyplain{}{\rightmark }}
\cfoot{\fancyplain{}{\thepage}}
The problem is that it prints the section number as well, which I don't want. I've experimented with removing the 1's in the code but that doesn't work.
Best Answer
\thesection
prints the section number (preceded by the chapter number, if you use a class that can include chapters, such asbook
). Get rid of it and of the following control space (\
) and you obtain the desired output: