Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When a single line of text is added to a footer, it is bottom-aligned to the margin as I would expect:

single line footer

However, when I add a second line of text, the alignment is still with the first line of text. I would expect the first line of text to move up, and for the whole paragraph to be bottom-aligned with the margin.

2 lines of footer

I would like to produce my document so that the bottom of the text "and another line of footer" in the example above aligns above the bottom margin, rather than the first "line of footer" text.

I've tried placing the text in a parbox, but to no avail.

I can't believe that this question hasn't been answered before, but I have looked at lots of similar questions, and cannot find one that is exactly the same scenario as this. This question is similar, but in that question the footer is still spilling into the bottom margin, rather than being bottom-aligned to it.

For info, what I am actually trying to do is place an image with some text below it into the footer, but I assume that the solution will be the same regardless.

Here is my MWE:

\documentclass[a4paper]{article}

\usepackage[includefoot,margin=0.8cm,showframe]{geometry}
\usepackage{lipsum,fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\lfoot{line of footer\\and another line of footer}

\begin{document}
\lipsum[1-15]
\end{document}

And just to clarify what I am trying to achieve:

how it should be

share|improve this question
    
possible duplicate of Footer spacing in LaTeX –  Masroor Apr 4 at 8:28
    
@MMA - thanks, I did see that, but it doesn't really work for me, as the footer text is still spilling over the margins. If you use showframe in the MWE of that question, you can see that the footer is either side of the bottom margin, rather than being bottom-aligned to the margin. –  abeverley Apr 4 at 8:43

1 Answer 1

up vote 6 down vote accepted

You can put your material in a \parbox and use the [b] option to make the alignment point be the baseline of the last line. Of course you should make sure there is enough room for the footer.

Sample ouptut

\documentclass[a4paper]{article}

\usepackage[includefoot,margin=0.8cm,showframe]{geometry}
\usepackage{lipsum,fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\lfoot{\parbox[b]{\textwidth}{line of footer\\and another line of footer}}

\begin{document}
\lipsum[1-15]
\end{document}
share|improve this answer
    
Fantastic, thank you! I thought I'd tried that (and played with the various alignment options) but I must have got something wrong. –  abeverley Apr 4 at 9:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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