TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I align an image to centre?

In a beamer presentation I have a 2-3 items on a slide followed by an image. The image is not wide enough to cover whole slide, so it leaves around 30% space from right. How do I adjust it to leave enough space on both sides?

\item apps
\item apps
\item apps
share|improve this question
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. – Marco Daniel Apr 30 '12 at 20:49
up vote 23 down vote accepted

It is enough to use the center enviroment:

share|improve this answer
In general you should use center only with text. It adds vertical space before and after the content, which is not really what you want most the time for images, especially not for floats. See Should I use center or centering for figures? and When should we use \begin{center} instead of \centering?. – Martin Scharrer Apr 30 '12 at 22:41
@MartinScharrer thanks for the clarification :) – gcedo May 30 '14 at 12:33
Another issue: if your margins are asymmetrical, the image will be centered with a text block which may or may not be there, not the page itself. – John Peyton Sep 30 '14 at 0:44

Here are two ways of achieving this:

  \includegraphics{<your image>}


\hfill\includegraphics{<your image>}\hspace*{\fill}

The former may add some vertical whitespace, while the latter centers its contents on the line used.

share|improve this answer
Third way \centerline{\includegraphics...}, perhaps you want to add it. Fourth way {\centering \includegraphics...\par} – Yiannis Lazarides Apr 30 '12 at 21:00
I personally think \centerline is just perfect to center single boxes like images. @YiannisLazarides – Martin Scharrer Apr 30 '12 at 22:42
I tend to prefer the opening-closing environments. So, I do not like much to use {\centering ...} but prefer \bgroup \centering ... \egroup. – cacamailg Dec 7 '15 at 10:30
@cacamailg: For what it's worth, they are equivalent, as you'll find \let\bgroup={ \let\egroup=} in the LaTeX kernel. – Werner Dec 7 '15 at 17:18

The third way is to use the figure environment, which is the best way in my opinion, since it provides the right mark-up. (beamer centers the figures by default.)

   \includegraphics{<your image>}

In this case on may also add a caption with \caption{<text>}

share|improve this answer

One simple way to center an image is to use the adjustbox package with the export option. It provides the center=<width> key to \includegraphics, which centers the image around the given width. It defaults to the \linewidth, so use:

% ....


Inside a itemize this will center the image relative to the itemize text width, not to the frame.

share|improve this answer

You could also do something like this:

    \caption{My caption}
share|improve this answer

I always use:


That's almost perfect for raw screenshots, as images will not overflow the visible content.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.