latex graphics inclusion techniques. the idea of the bounding box is the key to understanding...

10

Click here to load reader

Upload: erick-jordan

Post on 13-Jan-2016

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

LATEX

Graphics

Inclusion

Techniques

Page 2: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

The Idea of the Bounding Box is the key to understanding

graphical displays in LATEX, or any derivative (i.e. pdfTEX).

The box will set the size displayed and control what the viewport (cropped image) will

access.

Page 3: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

Graphics – Pictures, Images and graphs

JPEG – PNG – PDF – METAPOST

EPS (encapsulated PS)

Import Library:

\usepackage{graphicx}

Import Directive:

\includegraphics[options]{filename}

Example: \includegraphics[width=3in]{file.png}

The result of this call sets the width of the graphic to 3inches

Page 4: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

Available Options:

height – sets height of graphic( height=2cm )

totalheight – total height of graphic (height + depth)

width – sets width of graphic

angle – sets rotation in degrees about the origin, clockwise=neg

origin – [origin=c], indicates center graphic for rotation.

bb – bounding box. [bb = 10 20 100 200], sets 2 points, (10,20) represents lower-left corner of graphic, (100,200) is the upper right.

Cropping:

viewport – respect to the bb, [viewport = 10 20 50 50,clip = true], sets view area of graphic and clips it.

trim – [trim 1 2 3 4, clip=true] removes 1bp @left, 2bp @top…

Page 5: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

\documentclass[a4paper,12pt]{article}

\usepackage{graphicx}

\begin{document}

\begin{figure}

\begin{center}

\includegraphics[bb = 0 0 273 400]{tim.jpg}

\caption{this is a cat on a guy} \label{fig:graph}

\end{center}

\end{figure}

\begin{figure}

\includegraphics[bb=20 20 273 400, viewport= 0 200 273 375, clip=true]{tim.jpg}

\end{figure}

\end{document}

Page 6: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

\usepackage{graphicx}

\begin{document}

\begin{figure}

\begin{center}

\includegraphics[bb = 0 0 273 400]{tim.jpg}

\caption{this is a cat on a guy}

\label{fig:graph}

\end{center}

\end{figure}

\begin{figure}

\includegraphics[bb=20 20 273 400, viewport= 0 200 273 375, clip=true]{tim.jpg}

\caption{this is a cat -- sans guy}

\end{figure}

\end{document}

Page 7: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

If you substitute Tim.jpg with any picture, in the above example, you will see an initial full image, and a secondary (2nd page probably) of the cropped image of the top portion of the image.

The use of “\begin{figure}” will allow the technical writer (you) to indirectly refer to a previously defined figure by number; every time a \begin{figure} is encountered LATEX automatically increments the index of the figure.

Additionally, the figure reference allows for arbitrary page referencing by employing the \label{reference info} to tag the graphic. This allows reference by: “illustrated by the graphic”

\ref{reference info} -- name refered.

on page

\pageref{reference info}

reference info – {fig:graph} usual form

Page 8: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

Floating placement of Graphics

LATEX’s automated placement of figures will place according to accepted default behavior:

topnumber The max# of float figures at the top of page (default = 2).

bottomnumber The max# of float figures at the bottom page (default = 1).

totalnumber The max# of float figures on any page (default = 3).

Page 9: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

Wide Figures• 1 sided documents:

The following code uses this narrow environment to make the figure extend 1 inch into the left margin

\begin{figure}\begin{narrow}{-1in}{0in}\includegraphics[width=\linewidth]{wide}\caption{This is a wide figure}\end{narrow}\end{figure}

A Very, Very Wide Graphic

Page 10: LATEX Graphics Inclusion Techniques. The Idea of the Bounding Box is the key to understanding graphical displays in LATEX, or any derivative (i.e. pdfTEX)

Notes – Links – Software Providers

Graphics info Source: http://www.tex.ac.uk/tex-archive/info/epslatex.pdf