5

I'm trying to put two images and some text in my document footer, all aligned side by side with the page number, something like this:

enter image description here

I could get to the basics using fancyhdr, but it obviously doesn't work as expected. I'm a beginner in LaTeX so I'm having a really hard time adapting some answers I've seen that cover either side by side figures or aligning texts and figures in the footer:

\documentclass[onecolumn]{article}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}    
\lfoot{\includegraphics[scale=0.3]{example-image} \includegraphics[scale=0.15]{example-image} Some text to go in the footer}
\rfoot{\thepage}

\begin{document}

\lipsum
 
\end{document}

enter image description here

I know that I can solve the footer limits with footskip, but I can't figure how to make sure that all items are placed side by side and correctly aligned in my footer.

Thanks,

Bernardo

1
  • You probably received some warning in your .log about your large footer? Either way, it's obvious that the images are too big. How do you want to handle those oversized images? Do you want the images aligned vertically (centred, say)? Here I'm asking what you mean by "correctly aligned"...
    – Werner
    Dec 16, 2014 at 14:46

2 Answers 2

5
Some thing like this?

\documentclass[onecolumn]{article}

\usepackage{fancyhdr}
\usepackage[export]{adjustbox}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\lfoot{\includegraphics[scale=0.3,valign=c]{example-image}
       \includegraphics[scale=0.15,valign=c]{example-image}
       Some text to go in the footer}
\rfoot{\thepage}

\begin{document}

\lipsum

\end{document}

enter image description here

Or this

\documentclass[onecolumn]{article}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\lfoot{%
  \begin{minipage}{\textwidth}
  \parbox{0.23\linewidth}{\includegraphics[width=\linewidth]{example-image}}\hfill
  \parbox{0.23\linewidth}{\includegraphics[width=0.5\linewidth]{example-image}}\hfill
  \parbox{0.46\linewidth}{Some text to go in the footer Some text to go in the footer}\hfill
  \parbox{0.02\linewidth}{\raggedleft \thepage}%
  \end{minipage}
  }

\begin{document}

\lipsum

\end{document}
2
  • Thanks a lot, @Harish! I ended up testing only your second solution and it works perfectly. Instead of using hfillto equally space all parbox, I'm setting different widths for every one of them (I'm trying to get all figures/text close to each other and the page aligned to the right, but I didn't specify in my question). Is this a good approach?
    – Bernardo
    Dec 16, 2014 at 15:42
  • @Bernardo You are welcome. It is OK IMO as long as you have correct footskip calue. It all depends on your needs.
    – user11232
    Dec 16, 2014 at 23:38
2

Didn't know whether the red box was part of the notation or the footer itself (I assumed the latter). I put the text in a \parbox, added some vertical buffer around the \fbox, and I spaced out the items in the footer.

If you need actual boxes around the text and page number, let me know.

\documentclass[onecolumn]{article}
\usepackage{stackengine,xcolor}
\fboxrule=2pt
\newcommand\cincludegraphics[2][]{%
  \setbox0=\hbox{\includegraphics[#1]{#2}}%
  \abovebaseline[-.5\ht0]{\includegraphics[#1]{#2}}}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}  
\lfoot{\textcolor{red}{\addstackgap[3pt]{\fbox{\color{black}
  \makebox[\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax]{%
  \cincludegraphics[scale=0.3]{example-image}\hfil 
  \cincludegraphics[scale=0.15]{example-image}\hfil
  \parbox[c]{1in}{Some text to go in the footer}\hfil
}}}}}
\rfoot{\thepage~}

\begin{document}

\lipsum

\end{document}

enter image description here

1
  • Thanks four your time, Steven, I voted up @Harish answer, though, because I found easier to understand his code, but both answers are great! Just for the record, the red box was part of the notation, sorry for not specifying that.
    – Bernardo
    Dec 16, 2014 at 15:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .