You get three times a page 1 in the front matter: in the report
class the titlepage
environment which is used also by abstract
resets the page number to 1.
I suggest you to use the book
class with its \frontmatter
and \mainmatter
commands, with \chapter{\abstractname}
for the abstract in the front matter.
However also the report
class can be used, after patching the relevant commands; I show only the important parts, add the rest to suit. It's probably better to \usepackage[<options>]{geometry}
for setting the page parameters and \usepackage{setspace}
for the interline spacing.
Remember the \clearpage
command before \pagenumbering{arabic}
.
\documentclass[12pt]{report}
%%% PATCHES %%%
\usepackage{etoolbox}
\makeatletter
% Patch `titlepage` not to reset the page number
\patchcmd{\titlepage}{\setcounter{page}\@ne}{}{}{}
\patchcmd{\endtitlepage}{\setcounter{page}\@ne}{}{}{}
% Patch `abstract` so that it shows the page number
\patchcmd{\abstract}{\titlepage}{\titlepage\thispagestyle{plain}}{}{}
\makeatother
%%% END PATCHES %%%
\begin{document}
\pagenumbering{roman}
\begin{titlepage}
abc
\end{titlepage}
\begin{abstract}
dddd
\end{abstract}
\tableofcontents
\clearpage %%%%% <---- IMPORTANT
\pagenumbering{arabic}
\pagestyle{myheadings} \markright{}
\chapter{A}
\end{document}
There are not random results but inconsistent settings. Please use the option showframe
in the package geometry
and see the log file to understand what happen with your settings.
Take into account that top margin in Lyx should be 15 mm
plus headheight
plus headsep
and that header text should be enough small to fit in the headheight
, otherwise LaTeX will change his setting trying to do the best.
In the same way, bottom margin should be 15 mm
plus the footskip
, but the footer text must fit within the foot skip.
Taking this into account, you can already fix without problems the margins using the normal menu of LyX (Documents>Settings...>Page Margins), but there are nothing wrong checking "Defaults Margins" box and using the package geometry
directly in Documents>Settings...>LaTeX preamble. This allow you to use options of geometry
that LyX cannot manage, or use dynamic dimensions, so the margins are calculated correctly independently of the default font size:
\documentclass{article}
\usepackage[paperheight=16cm,paperwidth=14cm,showframe]{geometry}
\geometry{
lmargin=15mm,
rmargin=15mm,
tmargin=\dimexpr15mm+1.5\baselineskip,
bmargin=\dimexpr15mm+1.5\baselineskip,,
headheight=\baselineskip,
headsep=.5\baselineskip,
footskip=1.5\baselineskip}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\begin{document}
\section{Testing margins}
\lipsum*[1]\footnote{A foonote}
\lipsum*[2]\footnote{A foonote}
\lipsum*[3-5]
\end{document}
Some like \chead{\Huge A}
just at the end of the preamble will ruin this layout, but LaTeX warn you in the .log
file:
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 30.0pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
Also, as you can see in this MWE, the footnotes are not a problem at all, since they are included in the text area, not in the margins.
On the other hand, for a 12pt
article the default font size in footnotes (\footnotesize) is 10pt
, so you must use a \scriptsize
. See What point (pt) font size are \Large etc.? and Set font size for footnotes.
Best Answer
Mostly intended as a demonstation.