Another possibility is using scrlayer-scrpage
. I guess that your document is oneside
:
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\addtokomafont{pagehead}{\upshape}
\ihead*{Yourname, \pagemark}
With the article
class you have to use \maketitle\thispagestyle{empty}
to get an empty title page.
Oneside article
:
\documentclass{article}
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\addtokomafont{pagehead}{\upshape}
\ihead*{Yourname, \pagemark}
\author{Yourname}
\title{Title}
\usepackage{blindtext}% dummy text
\begin{document}
\maketitle\thispagestyle{empty}
\blinddocument
\blinddocument
\end{document}
Oneside report
:
\documentclass{report}
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\addtokomafont{pagehead}{\upshape}
\ihead*{Yourname, \pagemark}
\author{Yourname}
\title{Title}
\usepackage{blindtext}% dummy text
\begin{document}
\maketitle
\blinddocument
\blinddocument
\end{document}
Note, that the header appears also an chapter pages. To remove the header from the chapter pages simple use \ihead{...}
instead \ihead*{...}
.
If your document is twoside
an the header should be an the left hand side on both the even and the odd pages than you have to use
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\addtokomafont{pagehead}{\upshape}
\lehead*{Yourname, \pagemark}
\lohead*{Yourname, \pagemark}
Twoside report
:
\documentclass[twoside]{report}
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\addtokomafont{pagehead}{\upshape}
\lehead*{Yourname, \pagemark}
\lohead*{Yourname, \pagemark}
\author{Yourname}
\title{Title}
\usepackage{blindtext}% dummy text
\begin{document}
\maketitle
\blinddocument
\blinddocument
\end{document}