[Tex/LaTex] Centering images

aligngraphicshorizontal alignment

I made my images in Ipe. But there are some not centered:
enter image description here

But, there are others centered:
enter image description here

I use the same code for both (just changing, of course, the files names):

\begin{center}
  \begin{minipage}{\linewidth}
    \centering
    \includegraphics[scale=1]{m5c5f7}
  \end{minipage}
\end{center}

(it's .eps file). What should I do to change it? I also tried to put the 1st image centered in Ipe, but it didn't work.

Another thing that I tried to do it is to write \hspace{6cm}\includegraphics[scale=1]{m5c5f7}, but it didn't work either.

Thanks 🙂

Best Answer

Your centring efforts are almost certainly overkill here:

\begin{center}
  \begin{minipage}{\linewidth}
    \centering

Generally you should only need two commands to centre images:

  1. \centering\includegraphics{...} — when the figure is smaller than the text width
  2. \centerline{\includegraphics{...}} — when the figure is wider than the text width

If this doesn't appear to centre your image correctly, put \fbox{\includegraphics{...}} to see where the bounds of the image are; you may then need to either pad or crop the image to make it more symmetrical.

Related Question