# Page numbering in top corner

I want to number my pages in the top corner, left or right - it depends on the side of book, the left page in book should have number on the left side and the right page on the right side. It works now only for one side (right or left).

• Welcome to TeX.SE. Wnich document class do you employ, which formatting-related options do you pass to the document class, and do you load any packages, such as geometry, which affect the page layout? – Mico Oct 29 '16 at 19:19
• Packages like fancyhdr, titleps or scrlayer-scrpage let you customize the page headers (and footers). But all your efforts will be in vain, if your document is set up to be one-sided. – Johannes_B Oct 29 '16 at 19:19

## 1 Answer

New version: You can use \usepackage{scrlayer-scrpage}. And \ohead*{\pagemark} for outer pagemarks.

It works if your document is set up to be twoside.

Example:

\documentclass[10pt,a4paper,twoside]{article}
\usepackage[latin1]{inputenc}
\usepackage{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\clearpairofpagestyles
\ohead*{\pagemark}% alternativ \ohead[\pagemark]{\pagemark}

\begin{document}
\begin{titlepage}
\begin{center}
Titel
\end{center}
\end{titlepage}
\thispagestyle{empty}
\cleardoublepage
\setcounter{page}{1}                 %counter =1
first page \newpage
second page \newpage
... next page
\end{document}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Accepted(old packages):

You can use \usepackage{scrpage2}. For example \pagestyle{scrheadings}. Set pagemarks inside or outside: \ihead[\pagemark]{\pagemark} or \ohead[\pagemark]{\pagemark}.

It works if your document ist set up to be twoside. Example:

\documentclass[10pt,a4paper,twoside]{article}
\usepackage[latin1]{inputenc}
\usepackage{scrpage2}
\pagestyle{scrheadings} % headline and footnote style:scrpage2-package
\clearscrheadings % clear headlines
\clearscrheadfoot % clear footnote
\ihead[\pagemark]{\pagemark}
%\ohead[\pagemark]{\pagemark} %alternative

\begin{document}
\begin{titlepage}
\begin{center}
Titel
\end{center}
\end{titlepage}
\setcounter{page}{1}                 %counter =1
first page \newpage
second page \newpage
... next page
\end{document}

• scrpage2 is obsolete. package scrlayer-scrpage is the current package to use. – Johannes_B Feb 11 '17 at 15:47
• The titlepage is the one with the page counter one. Please load package showframe to see that the numbering is completely messed up. See also tex.stackexchange.com/questions/192870/… – Johannes_B Feb 11 '17 at 15:49