Graphics in LaTeX. Part II

At the end of last year I published article dedicated to graphics in LaTeX. Today I was finally going to write a sequel. Because of the volume of material I had to break the article into several parts.
In this article you will learn how to import raster and vector graphics.

Imported graphics


In our document you can import the finished image (both raster and vector). But for this we first need to connect the driver (thedvips, pdftex, etc.). For driver connection use the following syntax in the preamble of the document:
\ifx\pdfoutput\undefined
\usepackage{graphicx}
\else
\usepackage[pdftex]{graphicx}
\fi

To insert an image, use the command \includegraphics. The command syntax is as follows:
\includegraphics[keyval-list]{file},

where file — the name of the file and keyval-list — the list of keys that can be specified in the form key=value separated by commas.
The extension of the picture file in the \includegraphics can be omitted, because the driver knows which file types it can handle, and which are not. Driver dvips is a file with the extension eps, ps, eps.gz, ps.gz, eps.Z, as for the driver pdftexpng, pdf, jpg, mps, tif. When the file extension is not specified in the command, the driver sequentially adds the file name of all the known extensions until you find the first matching file. Example:
\includegraphics{01}


Possible keys:
the
    the
  • width=length — sets any Tex ovskih units of length the width of the area allocated for the drawing. Example:
    \includegraphics[width=1in]{01}
  • the
  • height=length — sets the height of the graphic. Example:
    \includegraphics[width=1in,height=10mm]{01}
  • the
  • totalheight=length — the full height. Did not understand, what for it is necessary)))
  • the
  • keepaspectratio — saves the proportion of the picture when you change the width and/or height. Example:
    \includegraphics[width=1in,%
    height=1cm,keepaspectratio]{01}

  • the
  • scale=scale — scale drawing at the scale times. Example:
    \includegraphics[scale=0.5]{01}
  • the
  • viewport=llx lly urx ury
  • the
  • trim=db dl du dr — these keys specify the so-called visible area of the picture. Here llx lly urx ury — is the x - and y-coordinates of the lower left and upper right corners of the visible area of the picture relative to a reference point, and dl db dr du is the distance between the left, bottom, the right and top borders of the visible area of the drawing and of the drawing. Example:
    \includegraphics[viewport=-5 -5 50 50]{01}
  • the
  • clip=boolean — if the value is true, this switch cuts off part of the image outside the visible area. Example:
    \includegraphics[viewport=-5 -5 50 50,clip]{01}
  • the
  • angle=angle — this key rotates the pattern on the angle degrees counter-clockwise. The axis of rotation passes through the reference point of the box. Example:
  • the
  • draft — at the stage of preparation of the document, you can use this key. He points out that instead of drawing you have to draw a frame and type in it the name of the file. Example:
    \includegraphics[scale=0.5,draft]{01}

Useful links:


the
Original article: alex.kotomanov.com/2009/02/03/graph_in_latex_2

P. S. In the next part I will tell about the color in LaTeX.
Article based on information from habrahabr.ru

Comments

Popular posts from this blog

Powershell and Cyrillic in the console (updated)

Active/Passive PostgreSQL Cluster, using Pacemaker, Corosync

Experience with the GPS logger Holux M-241. Working from under Windows, Mac OS X, Linux