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).
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}
-
2
scrpage2
is obsolete. packagescrlayer-scrpage
is the current package to use. Feb 11, 2017 at 15:47 -
2The 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/… Feb 11, 2017 at 15:49
geometry
, which affect the page layout?fancyhdr
,titleps
orscrlayer-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.