# Horizontal alignment of 3 elements in footer of a PDF output from RMarkdown using LaTex

How do I fix the horizontal alignment of my footer in a PDF file produced from an R Markdown using LaTex?

\usepackage{graphicx}
\usepackage{fancyhdr}
\fancyhf{}
\newcommand {\changefont} {%
\fontsize{6}{8}\selectfont
}
\pagestyle{fancy}
\fancyfoot[LE, LO]{\includegraphics[height=1.5cm]{image1.png}}
\fancyfoot[CE, CO]{\changefont This is the placeholder for the middle footer text that is very lengthy and occupies at least 3 lines}
\fancyfoot[RE, RO]{\includegraphics[height=1.5cm]{image2.png}}
\fancypagestyle{plain}{\pagestyle{fancy}}


And my RMD file has the following yaml:

---
title: "PDF Outpuf File"
output:
pdf_document:
includes:
---


How do I make the footer so that they're well-aligned horizontally (either bottom-, center-, or top-aligned)?

This is what I want my footer to look like (in-general).

But my bare pdf output looks like this (sorry had to blur the images and actual text).

For center and bottom aligned, you can place the contents of the footer items inside minipages like this:

\documentclass{book}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{fancyhdr}
\fancyhf{}
\newcommand {\changefont} {\fontsize{6}{8}\selectfont}
\pagestyle{fancy}
\fancyfoot[LE, LO]{
\begin{minipage}[c]{1.55cm}\includegraphics[height=1.5cm]{example-image-b}\end{minipage}}
\fancyfoot[CE, CO]{\begin{minipage}[c]{.6\textwidth}\changefont This is the placeholder for the middle footer text that is very lengthy and occupies at least 3 lines is very lengthy and occupies at least 3 lines is very lengthy and occupies at least 3 lines\end{minipage}}
\fancyfoot[RE, RO]{\begin{minipage}[c]{1.55cm}\includegraphics[height=1.5cm]{example-image-b}\end{minipage}}
\fancypagestyle{plain}{\pagestyle{fancy}}
\setlength{\footskip}{3cm}
\begin{document}
\lipsum
\end{document}


Output:

For bottom needs some hacks or other way...

PS: For better results in bottom, inner sep=0 would help too...