1

enter image description hereAlways the content of the footer starts from the top of the footer space. Here i have a multi-line footer and i would like its bottom be aligned with the bottom of the footer space.

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{datetime}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{geometry}
\geometry{includeheadfoot,a4paper, top=1in, bottom=2in}

\renewcommand\footrulewidth{0.1pt} \pagestyle{fancy} \fancyfoot[C]{% \makebox[0pt]{\begin{tabular}[b]{c} \textbf{this is the first line in footer} \ this is the second line in footer \ this is the third line in footer \end{tabular}}}

\begin{document} \lipsum[1] \end{document}[![enter image description here][1]][1]

Final solution My solution :

\fancyfoot[C]{%
  \begin{minipage}[b][1.5in][b]{\textwidth}{
  \centering\Longstack{
    \textbf{this is the first line in footer} \\
    this is the second line in footer \\
    this is the third line in footer
    this is the fourth line in footer%
}
  \end{minipage}}

as shown below the bottom part of the footer content remains at the bottom of the footer area however the number of lines in it.

enter image description here enter image description here

simpler solution My other solution :

\geometry{top=1in, bottom=1.8in, foot=0.5in}
% "foot=" is the space between the bottom of the text in the document
body and the top of the footer.
[ ... ]
\rfoot{\thapage/\pageref{LastPage}}
\cfoot{}
\lfoot{%
  \parbox[t][1.0in][t]{\textwidth}{
    \textbf{this is the first line in footer} \\
    this is the second line in footer \\
    this is the third line in footer
    this is the fourth line in footer%}}

enter image description here

  • The problem is then the footer text would push above the footer rule. Furthermore, text on the page could, depending how you did it, overlap the footer. What you really need to do is set your footer vertical space larger, if you intend to set tall footers. – Steven B. Segletes Apr 08 '21 at 16:42

1 Answers1

1

After comments conferring with the OP, I tried to reinforce the point that the bottom of the document text area remains fixed, regardless of what happens in the footer. In light of that constraint, the OP decided the next best thing to what was originally desired would be to have a fixed space between the bottom of the text and the footer.

That can be achieved by changing the \Longstack of my original answer to a \Longunderstack. It is up to the OP to decide the foot= value for the aesthetically pleasing look. Here, I choose 20pt. This means that multi-line footers will hang below the bottom of the designated footer box.

I again present the MWE with showframe turned on.

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{datetime}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[showframe]{geometry}
\geometry{includeheadfoot,a4paper, top=1in, bottom=2in,foot=20pt}

\renewcommand\footrulewidth{0.1pt} \pagestyle{fancy} \fancyfoot[C]{% \Longunderstack{ \textbf{this is the first line in footer} \ this is the second line in footer \ this is the third line in footer}} \usepackage[usestackEOL]{stackengine} \begin{document} \lipsum[1-5] \end{document}

enter image description here

Here, with [showframe] removed:

enter image description here

ORIGINAL APPROACH

You need to make your footer taller, if you want to stack lines. In this case I add foot=50pt to your \geometry specification. And to see the result with respect to the text areas, I temporarily add the [showframe] option to geometry.

I also changed the footer to a stack, which I think is easier in this case.

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{datetime}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[showframe]{geometry}
\geometry{includeheadfoot,a4paper, top=1in, bottom=2in,foot=50pt}

\renewcommand\footrulewidth{0.1pt} \pagestyle{fancy} \fancyfoot[C]{% \Longstack{ \textbf{this is the first line in footer} \ this is the second line in footer \ this is the third line in footer}} \usepackage[usestackEOL]{stackengine} \begin{document} \lipsum[1] \end{document}

enter image description here

With the [showframe] turned off:

enter image description here

  • isn't there any way to set the distance between the footer content's baseline with the page bottom border? if this is not possible i would need to set a separation between the bottom of the page body and the top of the footer. – user1850133 Apr 08 '21 at 19:12
  • @user1850133 It is not clear what you mean by "baseline" for a footer that takes multiple lines. However, foot= setting in geometry sets the distance between the bottom of the text and the bottom of the space intended for the footer. If the footer is smaller than the allocated space, it sits at the base of that space. But if the footer height exceeds the allocated space, the footer gets pushed downward, below its allocated area. Best to play with my MWE, with showframe on, and vary foot= from values too small to values too big, to see how it behaves. – Steven B. Segletes Apr 08 '21 at 19:18
  • i was not precise on the terminology. By baseline i mean the bottom of the footer content. In my initial request i wanted a footer which position is set on the basis of the distance between its bottom part and the page bottom edge. It mean that for whatever number of lines in the footer, the bottom one is always at the same distance from the bottom edge of the page. IOW by adding lines to the footer, it grows upward only. – user1850133 Apr 08 '21 at 20:45
  • If not possible, i would go for a space between the bottom of the page body and the top of the footer. – user1850133 Apr 08 '21 at 20:49
  • @user1850133 Please see my revision to see if it better addresses your need, given that (here is the important point) the bottom of the document text remains fixed, regardless of how tall your header is. – Steven B. Segletes Apr 08 '21 at 22:29
  • not sure what you understood out of my comment above. I have repeatedly insisted on "bottom of the footer" both in the title and in the post body, so why did you change the stack into a top anchored stack? – user1850133 Apr 09 '21 at 04:44
  • @user1850133 Because it is the only way to achieve your request, "i would go for a space between the bottom of the page body and the top of the footer." – Steven B. Segletes Apr 09 '21 at 14:50