0

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{\begin{equation}}
\def \ee{\end{equation}}
\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}
Drarp
  • 209

2 Answers2

1

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
\fancyhead[EL]{\leftmark}
\fancyhead[ER]{\thepage}
\fancyhead[OR]{\leftmark}
\fancyhead[OL]{\thepage}

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
\fancyhead[EL]{\leftmark}
\fancyhead[ER]{\thepage}
\fancyhead[OR]{\leftmark}
\fancyhead[OL]{\thepage}

\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}
Ben
  • 1,053
  • 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 http://tex.stackexchange.com/questions/139700/package-babel-error-unknown-option-francais installing additional language packages might also help. – Ben Oct 18 '15 at 18:57
  • other problem, the number of pages are in Romane: x, ix, so how we can do to obtain number of pager as 1, 2, 3..ect? Please. – Mathema Manoula Ens Tica Oct 18 '15 at 18:57
  • @MathemaManoulaEnsTica I've included the arabic numbering. See the edit. – Ben Oct 18 '15 at 19:01
  • Sorry but i don't indurstand. How we use \frontmatter to obtain arabic number of all pages? Please. – Mathema Manoula Ens Tica Oct 18 '15 at 19:04
  • @MathemaManoulaEnsTica Just delete it from the code. – Ben Oct 18 '15 at 19:05
  • ok, so the numbers are in arabic, but in roman on the contents. Add to this, when i replace [english]{babel} by [french]{babel}, it tell me" ! Package babel Error: Unknown language `english'. Either you have", so what i can do, please. – Mathema Manoula Ens Tica Oct 18 '15 at 19:10
  • @MathemaManoulaEnsTica I've included my complete code in the answer. See if that works for you. There are no roman numerals in this example. – Ben Oct 18 '15 at 19:19
  • Ok, tank you so much. There is an last problem if you can help me please. when i do an label for an picture, for exemple \label{fig1}, in the text i do \ref{fig1}, but it don't take in accuount the tru référence of the picture, it write fig{2.1.1} for all the picture of the documents. What i can do? Please. – Mathema Manoula Ens Tica Oct 18 '15 at 19:41
  • The unknown language error when changing the language comes from occurences of the old language in the aux files, delete all files but the pdf if you change language. Also you might want to add \usepackge[T1]{fontenc} to you preamble. I would also load the packages important for input encoding first. – MaxNoe Oct 18 '15 at 20:09
  • @MathemaManoulaEnsTica I don't know why it would print the same reference. I've never seen that before. Are you sure you used different labels and got the references right? I've included a small example in the code to get you going. The language issue was fixed right? – Ben Oct 18 '15 at 20:29
0

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.

vonbrand
  • 5,473