Sei sulla pagina 1di 3

A Inserting Figures or Pictures in L TEX Yau Ching Koon First edn.

, November 29, 2013

Suppose you have gure or picture named Picture1.jpg. This gure must be stored in the same
AT X, this is automatically the case. level as your .tex le. If you are using an on-line L E

Next in your .tex le, type two things on two separate parts. 1. First, you need to call in a package to handle the graphics. So at the preamble (meaning before

\begin{document}), type: \usepackage{graphicx}


2. Then, go to the text where you want to place the picture and type:

\begin{figure}[htp] \centering \includegraphics[scale=0.5]{Picture1.png} \caption{My picture} \label{fig1} \end{figure}

Compile to see if you have successfully insert the gure. You may play around with several things here. 1. Each of the alphabet in htp means here, top, and oat. Another one is b for bottom. It tells where to place the picture, as in here (where you wanted it), top for top of the page, bottom for bottom of page and oat for an entire new page. If typed as htp, LaTeX gives h the priority rst followed by t and then p. So, if you typed htp, then priority is given to t rst. However, LaTeX usually makes the best representation, for example even if you intend to put the picture here but due to the limited space available on that page, the picture will still oat to a new page. A minimum combination of two alphabets is required, e.g., bp. 1

2. \centering is to align the gure to the centre, not the default left. Try to remove this to see the effect. 3. scale=0.5 is to scale your gure. You may of course put scale=0.8, etc. to enlarge or diminish your gure. Another method is to use width=0.5\textwidth. While the former denes the size of your picture with respect to the original size, the latter denes the size with respect to the available space on your paper. 4. My picture is just the caption which can be changed to whatever appropriately describing your picture. 5. \label{fig1} is useful to create a hyperlink, e.g., click here: 1.

Figure 1: Jump to here.

Potrebbero piacerti anche