0

I have a document with the following configuration:

\documentclass[a4, 12pt]{article}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}

And the following fancyhdr definition:

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\leftmark}
\fancyhead[R]{\thepage}
\fancyfoot[L]{
    \includegraphics[height=1.5cm]{Images/Logo 1.jpg}
}
\fancyfoot[R]{
    \includegraphics[height=1.5cm]{Images/Logo 2.png}
}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}

Unfortunately, the footer content is slightly larger than 2.5cm which makes the text overlap with the hrule of the footer.

enter image description here

When I change the bottom value to 3cm the whole footer including the overlapping area just moves up. I tried using footskip and it works theoretically but the values are so confusing that it's a mess to add .5-1cm to the footer. I also read this but it does not help.

So how to keep the footer at the bottom when increasing the bottom value of the geometry?

Here is a minimal reproducible example. I want a top margin of about 0.5cm above the hrule of the footer so the text does not overlap.

Kaskorian
  • 127
  • I am confused as to what your issue is and what is the desired output. I am also confused why you are using \Longstack in the footer when you aren't stacking anything. Can you please edit your question to include a full, compilable minimum example that illustrates your problem, and more details about what the desired output should look like? – Willie Wong Jul 07 '23 at 20:21
  • New edit. The stack is an artifact from the answer to another question I read which did not work although the title of the question sounded promising – Kaskorian Jul 07 '23 at 20:46

2 Answers2

1

You need to add footskip=2.6cm to the options for geometry.

\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=3cm,footskip=2.6cm]{geometry}

should do the job.

By default, the bottom=3cm specifies that the bottom of the body text should be 3cm from the bottom of the paper. The bottom of the footer is set to be bottom-footskip away from the bottom of the paper. If your footskip is smaller than the size of material you are putting into the footer, then the footer will protrude above and run into your text.

Just changing bottom does not impact how much space is allocated to the footer. For more about what the various parameters mean, see the documentation to the geometry package, which has the following nice picture:

enter image description here

Willie Wong
  • 24,733
  • 8
  • 74
  • 106
0

What is confusing about footskip?

If you have an image of height 1.5 cm plus a rule and some space below, you will need a foot skip of around 1.7 cm or more to have any noticeable additional space above the rule.

With a foot skip from 0cm to 1.6cm you will no see difference because the footer is simply bigger that the space that you reserve for this. Then the option is only place the footer just after the main text and hope the best.

mwe

\documentclass[a4, 12pt]{article}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,footskip=2cm]{geometry}
\usepackage{fancyhdr,graphicx,lipsum}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\leftmark}
\fancyhead[R]{\thepage}
\fancyfoot[L]{\includegraphics[height=1.5cm]{example-image}}
\fancyfoot[R]{\includegraphics[height=1.5cm]{example-image}}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\begin{document}
\lipsum[2-11]
\end{document}
Fran
  • 80,769
  • Yeah now I understand footskip. But when I wanted ti figure out what footskip is I just printed the value using \printlength{\footskip} it printed 30pt which according to an online converter is 1.05437cm. When I set the footskip to this value nothing changed so I thought I was right. So I incremented both bottom and footskip by 1cm but this moved the footer completely out of town. So I said, I will not figure out a 'magic' number and just ask a question – Kaskorian Jul 07 '23 at 21:44