selinap.com

To leave furtively and stealthily.

Home » LaTeX

Insert figures to LaTeX

April 22nd, 2008

LaTeX is a good tool for creating articles or books. However, when it comes to inserting figures, it is a very cumbersome process. This tutorial will show the steps for producing LaTeX documents with figures. For the purpose of this tutorial, we will use a graph from an excel document.

Step 1: Highlight (left click) the graph in the excel file.

Step 2: Copy the graph into memory. Right click and select Copy. (or just press and hold Ctrl, and then press c)

Step 2

Step 3: Open Paint application. Click on the Start button, choose All Programs > Accessories > Paint.

Step 3

Step 4: Paste the graph that we have just copied into Paint. Click on Edit > Paste. (or just press and hold Ctrl, and then press v)

Step 4

Step 4a

Step 5: Now we are going to save our graph in JPEG format. Click File > Save As. A “Save As” dialog box will opened. Type the file name - graph. For the “Save as type” choose JPEG. For simplicity, make sure that the graph is saved in the save folder as the LaTeX document. Then, click on the save button.

Step 5

Step 5a

Step 6: Open the LaTeX document, and type the following LaTeX code:

\begin{figure}[htp]
\centering
\includegraphics{graph}
\caption{Some graph}
\label{fig:graph}
\end{figure}

Don’t forget to import the graphicx package, by inserting

\usepackage{graphicx}

at the top of the LaTeX document.

Step 7: Now we can produce the pdf document, using the pdflatex command.

note: This tutorial assumed that we are going to produce a pdf file, since pdflatex only accept PDF, PNG, JPEG and GIF format. For producing a postscript or dvi file, we need to convert the JPEG file (graph.jpg) to eps format. It could be done using tools such as jpeg2ps. However, it is beyond this tutorial.

Related Articles:

Popular Articles:

Spread/Promote this article.

Digg | Del.icio.us | Stumble | Y! MyWeb | Y! Buzz | Fave It! | Reddit

Subscribe for free.

 Subscribe to Selinap.com feed right now!

 Get Updates by Email

Tags: , , , , ,

One Response to “Insert figures to LaTeX”

  1. MOHAMAD NAJIB says:

    Maklumat yang sangat berguna. thanks.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">


© Copyright 2008 - 2009 selinap.com
Entries (RSS) and Comments (RSS).