# How to shift a large graph to the left

Basically, I have a large graph, which take almost half a page. Right now, when I compile the tex file, the graph shifts to the right on the pdf. I have label and caption on this graph. How can I shift it to the left such that it looks like it is being centered? I have checked out some other posts. However, none seems to work for me.

\begin{center}
\centering{\includegraphics[height =375px, width = 450px]{ABC.pdf} }
\captionof{figure}{ABC}
\label{abc}
\end{center}


Or maybe Someone can give me a solution that can allow to begin at position on the left while having the caption centre at the middle.

• See if tex.stackexchange.com/questions/16582/… helps. – Torbjørn T. Sep 15 '13 at 21:56
• or the xcenter environment of positioning of a matrix bigger than margins – Qrrbrbirlbel Sep 15 '13 at 22:09
• I tried using \makebox. It works, however because I am now using \begin{figure} , the graph is being put on the middle of the page, whereas before when I was using \begin{center}, the graph is placed at the top. – user1769197 Sep 15 '13 at 22:10
• Yeah, figures float, but you don't have to use that. Just keep center, or use a minipage. – Torbjørn T. Sep 15 '13 at 22:16

The \hsmash macro of the 9-11 release of the stackengine package makes LaTex think the image is zero width. Thus, it has no problem centering it, because it doesn't know it falls outside of the left margin.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{stackengine}[2013-09-11]
\usepackage{caption}
\begin{document}
{\centering
\hsmash{\includegraphics[height =375px, width = 450px]{ABC.pdf} }
\captionof{figure}{ABC}\label{abc}}

here is textwidth\\\rule{\textwidth}{1ex}
\end{document}


• What's \centering supposed to do? – egreg Sep 15 '13 at 22:29
• you don't want the \centering inside center (copied from original example) Is \hsmash{..} different from \makebox[0pt]{..} ? – David Carlisle Sep 15 '13 at 22:30
• @egreg oversight. Fixed. – Steven B. Segletes Sep 15 '13 at 22:31
• @DavidCarlisle center environment removed... Codewise, \hsmash is not a \makebox; It is more like a \clap (halfway between a \rlap and \llap). Functionally, I don't know if it acts differently from a \makebox[0pt]. – Steven B. Segletes Sep 15 '13 at 22:34
• @StevenB.Segletes I guess it's the same then:-) \makebox[0pt][clr] are left right or centred *lap depending on the second arguument, defaulting to c – David Carlisle Sep 15 '13 at 22:40