# Centre an image, ignoring margins

I have a document with .5cm margins; I want to include a long image which will span the width of the page, ignoring margins. I don't care about the whole image being visible (or which part of the image is visible, to be honest) so long as it spans the width. At present the image goes off the right-hand side of the page but its left edge is aligned to the margin.

\documentclass[a5paper,twoside]{article}
\usepackage{graphicx}
\usepackage[a5paper,margin=0.7in]{geometry}

\begin{document}

\newgeometry{margin=.5cm} %tiny margins

Text here.

\vfill

\begin{center}
\hspace{-1cm} \includegraphics[height=4cm]{image}
\end{center}

\vfill

Some text here (not very much).

\end{document}


Bonus question: it would also be very helpful if someone could explain how to position the image a set distance from the base of the page, as opposed to just using \vfills to space things out.

-
remove the center environment and use \hspace*{-whatever} the * form prevents space being discarded at start of line but a negative hspace after the image as well (and dont put a word space between the \hspace and the \includegraphics. –  David Carlisle Oct 22 '13 at 21:04

For horizontal placement that ignores margins, use Center figure that is wider than \textwidth. For vertical (say) 2cm from the bottom of the text block, use

\vspace*{\fill}

\noindent
\makebox[\textwidth]{\includegraphics[..]{...}}%

\vspace*{2cm}


If you have a single line of text at the bottom and you also want the image to be 2cm from the baseline, then use a strut:

\vspace*{\fill}

\noindent
\makebox[\textwidth]{\includegraphics[..]{...}}%

\rule{0pt}{2cm}Some text here (not very much).


Here's a complete MWE:

\documentclass[a5paper,twoside]{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage[a5paper,margin=5mm,showframe]{geometry}

\begin{document}

\vspace*{\fill}

\noindent\makebox[\textwidth]{\includegraphics[width=\textwidth,height=4cm]{example-image-a}}%

\vspace*{2cm}

\newpage

\vspace*{\fill}

\noindent\makebox[\textwidth]{\includegraphics[width=\textwidth,height=4cm]{example-image-a}}%

\rule{1pt}{2cm}Some text here (not very much).

\end{document}
`

Note the difference in height placement when you use text with descenders.

-