0

How can I create exactly the following spaces/distances? enter image description here

Margin from bottom to footerrule: 22mm
Distance from footerule to text: 5mm
Distance from Footerrule to top of footertext: 7mm

Current state: enter image description here

MWE:

\documentclass[14pt,oneside,a4paper]{article}
\usepackage[
  a4paper,
  left = 16mm,
  right = 16mm,
  textwidth = 178mm,
  top = 20mm,
  bottom= 22mm, % 22m lower bound + 5mm footer to text
  % headheight=17pt, % as per the warning by fancyhdr
  % includehead,
  % includefoot,
  heightrounded, % to avoid spurious underfull messages
  headheight=0mm,%
  headsep=0mm,%
]{geometry}
\usepackage[english]{babel}
\usepackage{blindtext}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Necessary packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\renewcommand\familydefault{\sfdefault}
\usepackage{ngerman}
\usepackage[scaled]{uarial}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{xcolor}
\usepackage{ifthen}
\setlength{\parindent}{0em}
\setlength{\parskip}{0em}
% \renewcommand{\baselinestretch}{0.0}
\usepackage{enumitem}
\usepackage[geometry]{ifsym}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Header and Footer Format
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \let\footruleskip\undefined %undefine footruleskip
\usepackage{fancyhdr}
\usepackage{calc}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.25mm}
\renewcommand{\footrule}{\hbox to\headwidth{\color{black}\leaders\hrule height \footrulewidth\hfill}}
\renewcommand{\footruleskip}{5mm} % 7
\setlength{\footskip}{5mm + 0.25mm + 7mm + 2.5mm}
\pagestyle{fancy}
\fancyhf{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Custom Footer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fancyfoot[L]{
  % \vfill
  \textbf{
      {\fontsize{9}{14}\selectfont SOME TITLE}
  }
}
\fancyfoot[R]{
  % \vfill
  \makebox[86mm][r]{%
       {\fontsize{9}{14}\selectfont Contact: info@website.com}
    \hfill
       {\fontsize{9}{14}\selectfont www.example.com}
  }%
}


\begin{document}
\Blinddocument
\end{document}
  • Unlike the header, the footer only has a baseline, no height. \footskip is the distance from the bottom (baseline) of the text area to the baseline of the footer. Figure \dp\strutbox overhang below both. – John Kormylo Apr 29 '19 at 22:56
0

I achieved my requirements with the following code.

Define the footskip in geometry: 7mm + 1em since I need the 7mm space and one line of text.

\usepackage[%
  a4paper,%
  left = 16mm,%
  right = 16mm,%
  textwidth = 178mm,%
  top = 20mm,%
  bottom= 22mm,%
  heightrounded,% to avoid spurious underfull messages
  headheight=0mm,%
  headsep=0mm,%
  footskip=7mm+8pt,%
  % showframe
]{geometry}

Afterward, I corrected my fancyhdr settings like the following:

\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.25mm}
\renewcommand{\footruleskip}{7mm}
\makeatletter
\patchcmd{\footrule}
  {\if@fancyplain}
  {\color{gray}\if@fancyplain}
  {}
  {}
\makeatother
\pagestyle{fancy}
\fancyhf{}

I achieve the additional 5mm between the footrule and the body with an extra \vspace{5mm} at the last element of each page (which is in my case always the same element).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.