Using Imported Graphics in LaTeX and pdfLaTeX - Mirror
Using Imported Graphics in LaTeX and pdfLaTeX - Mirror
Using Imported Graphics in LaTeX and pdfLaTeX - Mirror
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Graphic<br />
Graphic<br />
Figure 6: M<strong>in</strong>ipages with Tops Aligned<br />
12 Overlay<strong>in</strong>g Two <strong>Imported</strong> <strong>Graphics</strong><br />
This section describes how to overlay two graphics. Note that there is no guarantee<br />
that the top graphic is transparent; it may have been created with an opaque<br />
background that hides the bottom graphic.<br />
For example 18 , the files left.eps <strong>and</strong> right.eps conta<strong>in</strong> the graphics shown <strong>in</strong><br />
Figure 7, then the comm<strong>and</strong>s<br />
\makebox[0pt][l]{\<strong>in</strong>cludegraphics{left.eps}}%<br />
\<strong>in</strong>cludegraphics{right.eps}<br />
overlay the two graphics, as shown <strong>in</strong> Figure 8. The graphics are overlaid with their<br />
reference (lower-left) po<strong>in</strong>ts co<strong>in</strong>cident. In this particular example, the graphics had<br />
identical natural sizes so they overlaid perfectly without any scal<strong>in</strong>g. Other pairs of<br />
graphics may require scal<strong>in</strong>g (by \<strong>in</strong>cludegraphics, \scalebox, or \resizebox) to<br />
achieve the desired overlay<strong>in</strong>g.<br />
This overlay<strong>in</strong>g code may seem mysterious unless one underst<strong>and</strong>s the \makebox<br />
comm<strong>and</strong>. The \makebox[0pt][l]{...} creates a zero-width box <strong>in</strong> which its argument<br />
is placed. When a width is specified (0 pt <strong>in</strong> this case), the typesett<strong>in</strong>g<br />
algorithms allocate this much horizontal space regardless of the actual width of the<br />
contents. Thus, a left-justified zero-width box causes the L A TEX objects follow<strong>in</strong>g the<br />
box to be typeset on top of the contents of the box.<br />
Left<br />
Right<br />
(a) Contents of left.eps<br />
(b) Contents of right.eps<br />
Figure 7: Contents of <strong>Graphics</strong> Files<br />
Left<br />
Right<br />
Figure 8: Two overlaid graphics<br />
18 Although this example overlays two eps files, similar code can be used for overlay<strong>in</strong>g other<br />
graphic formats.<br />
38