Numbering of pages on LaTeX document

I have the preamble below, and I want to modify it to obtain:

1. the numeration of pages with 1,2, ...etc., not with x,xi, ...etc.
2. a line at the top of the page with the right name of the section and the pagenumber to the left.

What modifications do I need?

\documentclass[11pt]{book}
\usepackage{amssymb,amsbsy,amsmath,amsfonts,amssymb,amscd,colordvi}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{times}
%\usepackage{showkeys}
\usepackage{euscript}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage[utf8]{inputenc}

\usepackage[top=3.5cm, left=30mm, right=20mm,bottom=3.5cm]{geometry}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\topmargin=0cm
\oddsidemargin=0cm
\textwidth=17cm
\textheight=23.0cm
\topmargin=-1cm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \croix{\hbox{\bf \Large +}}
\newcommand{\Fe}{\mathcal F^{\varepsilon}}
\def \vd{{\varepsilon,\delta}}
\def\d{\delta}
\def \ve{\varepsilon}
\def \eps{\epsilon}
\def \limsup{\mathop{\overline {\rm lim}}}
\def \liminf{\mathop{\underline{\rm lim}}}
\def \be{$$} \def \ee{$$}
\def \mm{\mathfrak{M}}
\def \ff{\mathfrak{F}}
\def \ge{\mathfrak{g}}
\def \aa{\mathfrak{A}}
\def \e1{\mathfrak{e}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \ved{{\varepsilon,\delta}}%
\def \vedka{{\varepsilon,\delta,\varkappa}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \eqdef{\stackrel {\rm def} {=}}
\usepackage{color}
\def\red{\textcolor{red}}
\def\blue{\textcolor{blue}}
\def\green{\textcolor{green}}
\def\magenta{\textcolor{magenta}}
\def\cyan{\textcolor{cyan}}
\def \meas{{\rm meas}\,}
\def \div{{\rm div}\,}
% % % % % % % % % % % % % % % %
\def\oz{\overline{z}}
\def\ox{\overline{x}}
\def\mx{\mathsf m}
\def\fr{\mathsf f}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{definition}[theorem]{Definition}
\newtheorem{remark}{\rm Remark\/}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%le petit carre de fin de demonstration
\def \trait (#1) (#2) (#3){\vrule width #1pt height #2pt depth #3pt}
\def \fin{\hfill
\trait (0.1) (5) (0)
\trait (5) (0.1) (0)
\kern-5pt
\trait (5) (5) (-4.9)
\trait (0.1) (5) (0)
\medskip}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\font \twbbb= msbm10 scaled \magstep0                 % definitions
\font \tenbbb= msbm7 scaled \magstep0                 % for the font
\newfam\bbbfam \def\Bbb{\fam\bbbfam\twbbb}            % \Bbb
\textfont\bbbfam=\twbbb \scriptfont\bbbfam=\tenbbb    %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \R{{\Bbb R}} \def \C{{\Bbb C}} \def \Z{{\Bbb Z}}
\def \I{{\Bbb I}} \def \N{{\Bbb N}}
\def \ww{\mathfrak{w}}
\def \rr{\mathfrak{r}}
\def \ss{\mathfrak{S}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\renewcommand{\theequation}{\thechapter .\arabic{equation}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\baselinestretch}{1.2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\frontmatter

\begin{small}

\tableofcontents

\end{small}

• Hi and welcome. It would help if you'd reduce your code to a minimal example and showed us also your \documentclass line. – MaxNoe Oct 18 '15 at 16:16
• \frontmatter sets up roman page numbers, \mainmatter switches to arabic. If you don't want the ToC etc. to have roman page numbers, just remove \frontmatter ... – Torbjørn T. Oct 18 '15 at 16:58
• Where did you get that preamble from? This is like time travelling into the past. Quite a bit of that stuff is obsolete and should not be used. – Johannes_B Oct 18 '15 at 17:13
• And there are packages which are loaded multiple times (even in the same command) – MaxNoe Oct 18 '15 at 17:24

The follong code should take care of the header.

\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{} % clear header and footer
\fancyhead[R]{\leftmark} % write chapter to the right side
\fancyhead[L]{\thepage} % pagenumber on the left


Note that the book documentclass alternates the page margins. So it might look odd to always have the number on the left and the chapter on the right. You can try something like the following to also alternate the position of the numbering and the section.

\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{} % clear header and footer


As stated by Torbjorn T. arabic page numbering can be achieved by removing \frontmatter.

Because there still seem to be some misunderstandings I'm including the code that compiled without errors on my PC. As you can see I got rid of most of the preamble, since it was not needed. The problem with the references is also adressed.

\documentclass[11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[frenchb]{babel}
\usepackage{lipsum}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{} % clear header and footer

\begin{document}

\begin{small}
\tableofcontents
\end{small}

\chapter{figures}
\begin{figure}
\centering
\includegraphics[width = 0.5\linewidth]{example-image-a}
\caption{An image}
\label{fig:ex_a}
\end{figure}
\begin{figure}
\centering
\includegraphics[width = 0.5\linewidth]{example-image-b}
\caption{Another image}
\label{fig:ex_b}
\end{figure}

This is \ref{fig:ex_a} and this is another figure called \ref{fig:ex_b}.
\chapter{lipsum}
\lipsum[1-30]
\end{document}

• Thank you for the answer. Please, how we can obtain the title "contains" in french "Table des matières"? – Mathema Manoula Ens Tica Oct 18 '15 at 18:25
• I think you can select the correct language in the babel package. \usepackage[french]{babel} should do the trick. – Ben Oct 18 '15 at 18:27
• i try it but it tell me: ! Package babel Error: Unknown option french'. Either you misspelled it – Mathema Manoula Ens Tica Oct 18 '15 at 18:51
• Try \usepackage[frenchb]{babel}`. – Ben Oct 18 '15 at 18:54
• @MathemaManoulaEnsTica As stated in this post tex.stackexchange.com/questions/139700/… installing additional language packages might also help. – Ben Oct 18 '15 at 18:57

Yes, you can change all that. More power to (La)TeX! All hail Knuth and Lamport. And bless their innumerable minions.

On the other hand, many of the hard (or next to impossible) to change aspects of how LaTeX typesets documents are the result of literally hundreds of years of trial and error by professional typesetters. Even some of the easy to change ones are. Unless you really understand the rationale for the seemingly arbitrary decisions, keep well away from changing them.

• Well, excuse me but what does this mean? :) – user11232 Oct 19 '15 at 2:30