1

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 :)

6
  • 1
    Is the "pontos correspondentes..." paragraph part of the image? If it is, then I feel that the image is centered. Commented Jul 7, 2014 at 1:39
  • No, it's not haha @olga.saucedo
    – mvfs314
    Commented Jul 7, 2014 at 1:43
  • 2
    If that's truly the case, please, show us an MWE. Commented Jul 7, 2014 at 1:48
  • I never used IPE, but the reason can be that the bounding box of an .eps is wrong (it happens with pstricks when pure graphics is mixed up with text. A solution consists un converting the .eps files to .pdf, with epspdf (or epspdftk`` under Windows). It converts with the help of GhostScript and crops the image to obtain an exact bounding box. Then you compile directly with pdflatex. The application is a texlua script available on CTAN.
    – Bernard
    Commented Jul 7, 2014 at 1:53
  • I'm gonna try here @Bernard. Do you have any suggestion about another program to draw images? Thanks :)
    – mvfs314
    Commented Jul 7, 2014 at 1:57

1 Answer 1

5

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.

3
  • I'd avoid \centerline{...} and favor \makebox[\textwidth]{...}: \centerline isn't documented and it may have surprising effects.
    – egreg
    Commented Jul 7, 2014 at 6:52
  • @egreg — a matter of taste :) at least \centerline is somewhat semantic out of the box. I agree it's not the cleanest implementation, but it is memorable. I admit this is a controversial opinion of mine. Commented Jul 7, 2014 at 7:08
  • Actually, I just created another file and it worked haha but thanks anyway :)
    – mvfs314
    Commented Jul 8, 2014 at 0:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .