Search code examples
latexpdflatexoverleaf

Put full page width image at bottom of page in Overleaf


I have an Invoice template I want to fill. As part of an Invoice where I live we put a payment slip in the footer of the last page of that Invoice. I have generated a paymentslip in png format. It is about the size of an a4 paper and I want to put it at the bottom of it's own page. The Invoice having a footnote and all details in the First page.

I based myself on this template in Overleaf. https://github.com/eroux/latex-yait

So after all the template is customized, I insert the payment slip with

\newpage

\begin{figure}[b!]
    \makebox[\textwidth]{\includegraphics{images/paymentslip.png}}
\end{figure}

The \makebox is needed so the payment slip png has no indentation. However this snippet renders the payment slip at about center of the page. Playing around with all the different options from google did not result what I wanted.

It might be the Image width that is the problem. Has anybody any idea how I can define a box at the bottom of the page and align the payment slip at the bottom of that in latex?


Solution

  • With tikz, it is very easy to place elements with respect to the paper:

    \documentclass{article}
    
    \usepackage{tikz}
    
    \begin{document}
    
    your document
    
    \clearpage
    
    \begin{tikzpicture}[remember picture, overlay, inner sep=0pt]
    \node[anchor=south west] at (current page.south west) {\includegraphics[width=\paperwidth]{example-image-duck}};
    \end{tikzpicture}
    
    \end{document}