Question still unanswered
I am trying to set up margins equal to 2.5cm all around the document. With use of geometry (and fancyhdr) package which is:
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.50cm]{geometry}
However i have noticed that by default top and bottom margins are slightly bigger than the left and right. Why is it like that and how to fix it?
Thus how to make those margins (all of them) identical and equal to 2.5cm?
My entire code is:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\newcommand*{\savedfootnotes}{}
\newcommand*{\resetsavedfootnotes}{\global\let\savedfootnotes\empty}
\newcommand{\tablefootnote}[1]%
{%
\footnotemark
\xdef\savedfootnotes%
{\unexpanded\expandafter{\savedfootnotes}\noexpand\footnotetext{#1}}%
}
\edef\endtable%
{%
\aftergroup\noexpand\savedfootnotes
\aftergroup\noexpand\resetsavedfootnotes
\unexpanded\expandafter{\endtable}%
}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{lastpage}
\usepackage{titling}
\usepackage{array}
\usepackage{titlesec}
\usepackage{bibentry}
\nobibliography*
\usepackage{tocloft}
\usepackage{titling}
\newcommand{\subtitle}[1]{%
\posttitle{%
\par\end{center}
\begin{center}\large#1\end{center}
\vskip0.5em}%
}
\renewcommand\cftsecfont{\normalfont}
\renewcommand\cftsecpagefont{\normalfont}
\renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}
\renewcommand\cftsecdotsep{\cftdot}
\renewcommand\cftsubsecdotsep{\cftdot}
\usepackage{cite}
\usepackage{fancyhdr}
\usepackage[pdftex,
pdfauthor={},
pdftitle={}]{hyperref}
%
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
\linespread{1.5}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.50cm]{geometry}
\pagestyle{fancy}
\cfoot{ \thepage}
\setlength{\droptitle}{5cm}
\setlength\parindent{1cm}
\makeatletter
\renewcommand\thesection{}
\renewcommand\thesubsection{\@arabic\c@section.\@arabic\c@subsection}
\makeatother
\titlespacing*{\section}
{2.5cm}{0 pt}{1.5 pt}
\titlespacing*{\subsection}
{2.5cm}{1.5 pt}{1.5 pt}
\setcounter{section}{-1}
\begin{document}
\pagenumbering{gobble}
\pagenumbering{arabic}
\setcounter{page}{0}
\thispagestyle{empty}
\clearpage
title page
\newpage
\tableofcontents
\newpage
\section{\hfil 0 \hfil}
\newpage
\section{\hfil 1 \hfil}
\section{\hfil Bib \hfil}
\nocite{*}
\begingroup
\renewcommand{\section}[2]{}
\bibliographystyle{plain}
\bibliography{bibl2}
\endgroup
\newpage
\end{document}
At the top of it i have 0.1 inches more that on the left hand side. I want to have 1inch everywhere
Edit by touhami
Following comments it seems that the question is how to remove the gap between the frame and section title (this is related to titlesec)
\documentclass[12pt,a4paper]{article}
\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.50cm,showframe]{geometry}
\usepackage{titlesec}
\usepackage{mwe}% just for the example
\linespread{1.5}
\begin{document}
\blinddocument
\end{document}


includefoot,includeheadand so on in the documentation of the geometry package. – Jürgen Mar 29 '17 at 11:42\noexpand\footnotetext{\unexpanded{#1}}instead of\noexpand\footnotetext{#1}– egreg Mar 29 '17 at 17:29\usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.50cm,showframe]{geometry}– touhami Mar 29 '17 at 17:33\linespread{1.5}? Which is probably not what you want, in fact. Use the facilities ofsetspaceinstead. Off-topic:hyperrefshould be loaded last. – cfr Mar 29 '17 at 23:31\newpagein a document. Almost certainly, you are using the wrong class. – cfr Mar 29 '17 at 23:34titlesecis responsible. Remove that code and there is no space. – cfr Mar 29 '17 at 23:46\hfilat the begin or end of\sectioncommands. You should configure the headings instead. Note, that the\hfilwill be at the table of contents and the running head too, unless you use the optional argument of\section. – Schweinebacke Mar 30 '17 at 05:39titlesecpackage, do you really need to use it, (from your code it seems not necessary) – touhami Mar 30 '17 at 08:03\titlespacing*{\section} {2.5cm}{0 pt}{1.5 pt}so section's title start at 5cm from the left edge is this what you want? – touhami Mar 31 '17 at 17:59\usepackage{titling}appears twice. – barbara beeton Mar 31 '17 at 20:09