background preloader

Figures and Tables

Facebook Twitter

How do I fill table cells with a background color. Including graphics in LaTeX/PDF documents. Here we discuss how to include graphics in a LaTeX document intended to be later converted to PDF format, paying special attention to how to maintain simultaneous DVI and PDF versions of the same document.

Including graphics in LaTeX/PDF documents

If the document has no graphics, the DVI version can be produced with latex, and the PDF version with pdflatex: latex filename.tex pdflatex filename.tex If the document does have graphics, then a solution is to produce a PostScript version with dvips (taking care of using the -Ppdf flag) and to distill it later with the Acrobat Distiller. In our system both operations can be done in one step by using the dvi2pdf command: dvi2pdf filename.dvi However this has several drawbacks. Dvipdfm filename.dvi Another alternative (which we discuss below) is to to include graphics in a way that both latex and pdflatex can manage. Graphics can be produced in various formats.

Make a PDF version of the figure: epstopdf foo.ps That produces foo.pdf. The syntax of the \includegraphics command is as follows: Inserting a Figure into a Latex Document. LaTeX/Floats, Figures and Captions. The previous chapter introduced importing graphics.

LaTeX/Floats, Figures and Captions

However, just having a picture stuck in between paragraphs does not look professional. For starters, we want a way of adding captions, and to be able to cross-reference. What we need is a way of defining figures. It would also be good if LaTeX could apply principles similar to when it arranges text to look its best to arranging pictures as well. This is where floats come into play. Floats[edit] Floats are containers for things in a document that cannot be broken over a page.

Floats are not part of the normal stream of text, but separate entities, positioned in a part of the page to themselves (top, middle, bottom, left, right, or wherever the designer specifies). Authors sometimes have many floats occurring in rapid succession, which raises the problem of how they are supposed to fit on the page and still leave room for text. Figures[edit] To create a figure that floats, use the figure environment.

Figures with borders[edit] Tables[edit] LaTeX examples - reference a figure or table. LaTeX table/figure FAQ: How do I reference a table or figure in a LaTeX document?

LaTeX examples - reference a figure or table

Being able to automatically reference a figure within a LaTeX document is a very cool thing. This referencing capability lets you easily give readers the exact number of a figure, or tell them what page number a figure is located on with the use of a few simple commands (\label, \ref, and \pageref). The same technique works for referencing other objects within a LaTeX document, including tables and equations. Here’s the simple two-step process to use and reference figures in LaTeX documents. Back to top 1) Define your LaTeX figure To begin with, assume that you have a figure defined somewhere in a LaTeX document like this: (As you’ll see from the many comments below, the order of these lines is very important: The \caption tag must come before the \label tag.

Let’s further assume that as it turns out, in the current version of your document, this is Figure 11-1 in the document, and it appears on page 69. Summary.