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

This question already has an answer here:

I've a problem with image import in LaTex. I want to set all images centered, i tried a lot of commands found around here but nothing seems works. Now I have encountered another problem, because images aren't positioned in the right part of the document @_@ I'm new with LaTex, so probably is a noob's mistake.

Here is the code:








    \caption{Nota: in questo caso si \`e costretti a utilizzare la query con ORDER BY per via della condizione sull' ID non rispettata.}

I can't post the image for results, but it's like this:

8.1 Cliente
Image. -> Not centered.

8.2 Contratto
Image. -> Not centered.

8.3 Società
NO IMAGE -> It is in the next page.

8.4 Impianti
NO IMAGE -> It is in the next page.

Another question: How can I insert the result of a query SQL in LaTex without use a screenshot? With "result of a query" I mean:

| Col1     | Col2     |
| Val1     | Val2     |

Hope that someone can help me, Thanks :)

P.s. Sorry for my bad English.

share|improve this question

migrated from stackoverflow.com Jan 24 '14 at 22:18

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Torbjørn T., Svend Tveskæg, Guido, Adam Liter, Peter Jansson Mar 16 '14 at 20:44

This question was marked as an exact duplicate of an existing question.

Insert \centering inside the figure environment. – Sigur Jan 24 '14 at 22:23
Welcome to TeX.SX! Your post was migrated here from another Stack Exchange site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Herr K. Jan 24 '14 at 22:23
1) PNG does not support multiple images (animation) unlike GIF. Thus page=1 is not needed. 2) width=1.5\textwidth means the image will never fit in \textwidth and not fit in \linewidth that is usually equal or smaller than \textwidth. The result is an overfull \hbox warning and centering is not an issue. Smaller images can be horizontally centered by using \centering at the start of the figure environment. 3) center is not an option for \includegraphics. – Heiko Oberdiek Jan 25 '14 at 0:25
For the centering issue, see tex.stackexchange.com/questions/16582/…, though with .5\textwidth it may run off the page on both sides. – Torbjørn T. Feb 24 '14 at 8:36

You could use \centering or \begin{center}, maybe this page help you.

share|improve this answer
Thanks for the answer. With \begin{center} the images are in their right position but why aren't centered? My images have big width, and if I increase the scale value the left and right margins do not remain the same. – Nasca91 Jan 10 '14 at 15:56
Try using \begin{figure}[H!], Here you have a more detailed explanation, wikibooks – algui91 Jan 10 '14 at 16:53