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

mvfs314
  • 543
  • 1
    Is the "pontos correspondentes..." paragraph part of the image? If it is, then I feel that the image is centered. – olga.saucedo Jul 07 '14 at 01:39
  • No, it's not haha @olga.saucedo – mvfs314 Jul 07 '14 at 01:43
  • 2
    If that's truly the case, please, show us an MWE. – Paul Gessler Jul 07 '14 at 01: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 Jul 07 '14 at 01:53
  • I'm gonna try here @Bernard. Do you have any suggestion about another program to draw images? Thanks :) – mvfs314 Jul 07 '14 at 01:57
  • I don't know well Tikz/Pgf, which is one of the possible solutions. Personally I use pstricks. It has many specialised extensions (e.g. pst-eucl for Euclidean plane geometry, pst-poly for all sorts of polygons, pst-node, pst-plot, &c.) and is well documented. It's an interface between LaTeX and PostScript, and nowadays can be compiled with |pdflatex if you load it with the [pdf] option. Take a look at its home page to see what can be done with it: http://tug.org/PSTricks/main.cgi/ – Bernard Jul 07 '14 at 18:32

1 Answers1

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.

  • I'd avoid \centerline{...} and favor \makebox[\textwidth]{...}: \centerline isn't documented and it may have surprising effects. – egreg Jul 07 '14 at 06: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. – Will Robertson Jul 07 '14 at 07:08
  • Actually, I just created another file and it worked haha but thanks anyway :) – mvfs314 Jul 08 '14 at 00:05