File indexing completed on 2024-11-24 04:34:44
0001 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 0002 <html> 0003 <!-- This document is an unofficial reference manual for LaTeX, a 0004 document preparation system, version of November 2018. 0005 0006 This manual was originally translated from LATEX.HLP v1.0a in the 0007 VMS Help Library. The pre-translation version was written by 0008 George D. Greenwade of Sam Houston State University. The 0009 LaTeX 2.09 version was written by Stephen Gilmore. The 0010 LaTeX2e version was adapted from this by Torsten Martinsen. Karl 0011 Berry made further updates and additions, and gratefully acknowledges 0012 using Hypertext Help with LaTeX, by Sheldon Green, and 0013 LaTeX Command Summary (for LaTeX 2.09) by 0014 L. Botway and C. Biemesderfer (published by the TeX Users 0015 Group as TeXniques number 10), as reference material. We also 0016 gratefully acknowledge additional material appearing in 0017 latex2e-reference by Martin Herbert Dietze. (From these references no 0018 text was directly copied.) 0019 0020 Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013, 0021 2014, 2015, 2016, 2017, 2018 Karl Berry. 0022 0023 Copyright 1988, 1994, 2007 Stephen Gilmore. 0024 0025 Copyright 1994, 1995, 1996 Torsten Martinsen. 0026 0027 Permission is granted to make and distribute verbatim copies of 0028 this manual provided the copyright notice and this permission notice 0029 are preserved on all copies. 0030 0031 0032 Permission is granted to copy and distribute modified versions of this 0033 manual under the conditions for verbatim copying, provided that the entire 0034 resulting derived work is distributed under the terms of a permission 0035 notice identical to this one. 0036 0037 Permission is granted to copy and distribute translations of this manual 0038 into another language, under the above conditions for modified versions. --> 0039 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ --> 0040 <head> 0041 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 0042 <title>picture (LaTeX2e unofficial reference manual (November 2018))</title> 0043 0044 <meta name="description" content="picture (LaTeX2e unofficial reference manual (November 2018))"> 0045 <meta name="keywords" content="picture (LaTeX2e unofficial reference manual (November 2018))"> 0046 <meta name="resource-type" content="document"> 0047 <meta name="distribution" content="global"> 0048 <meta name="Generator" content="makeinfo"> 0049 <link href="index.html#Top" rel="start" title="Top"> 0050 <link href="IndexDocument.html#Index" rel="index" title="Index"> 0051 <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> 0052 <link href="Environments.html#Environments" rel="up" title="Environments"> 0053 <link href="_005cput.html#g_t_005cput" rel="next" title="\put"> 0054 <link href="minipage.html#minipage" rel="prev" title="minipage"> 0055 <style type="text/css"> 0056 <!-- 0057 /* $Id: latex2e.css 690 2018-09-15 15:20:19Z jimhefferon $ 0058 Minor css for latexrefman. Public domain. 0059 Originally written by Jim Hefferon and Karl Berry, 2018. */ 0060 0061 /* So you can style for yourself */ 0062 @import url("/css/latexreflocal.css"); 0063 0064 0065 0066 a.summary-letter {text-decoration: none} 0067 blockquote.indentedblock {margin-right: 0em} 0068 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} 0069 blockquote.smallquotation {font-size: smaller} 0070 div.display {margin-left: 3.2em} 0071 div.example {margin-left: 3.2em} 0072 div.lisp {margin-left: 3.2em} 0073 div.smalldisplay {margin-left: 3.2em} 0074 div.smallexample {margin-left: 3.2em} 0075 div.smalllisp {margin-left: 3.2em} 0076 kbd {font-style: oblique} 0077 pre.display {font-family: inherit} 0078 pre.format {font-family: inherit} 0079 pre.menu-comment {font-family: serif} 0080 pre.menu-preformatted {font-family: serif} 0081 pre.smalldisplay {font-family: inherit; font-size: smaller} 0082 pre.smallexample {font-size: smaller} 0083 pre.smallformat {font-family: inherit; font-size: smaller} 0084 pre.smalllisp {font-size: smaller} 0085 span.nolinebreak {white-space: nowrap} 0086 span.roman {font-family: initial; font-weight: normal} 0087 span.sansserif {font-family: sans-serif; font-weight: normal} 0088 ul.no-bullet {list-style: none} 0089 BODY { 0090 margin-top: 1em; 0091 margin-left: 1em; /* auto results in two-digit <ol> lost off left */ 0092 margin-right: 1em; 0093 margin-bottom: 1em; 0094 /* the idea is to use the whole window, unless it is ridiculously 0095 wide, probably with too-small fonts, too. */ 0096 max-width: 64em; 0097 } 0098 0099 /* Because we want @math{... @code ...} to be upright, not slanted, 0100 and Texinfo won't fix it. */ 0101 code {font-style:normal; font-family:monospace; } 0102 0103 /* We put a link to our own home page at the bottom. */ 0104 div.referenceinfo {font-size:small;} 0105 0106 --> 0107 </style> 0108 0109 0110 </head> 0111 0112 <body lang="en"> 0113 <a name="picture"></a> 0114 <div class="header"> 0115 <p> 0116 Next: <a href="quotation-_0026-quote.html#quotation-_0026-quote" accesskey="n" rel="next">quotation & quote</a>, Previous: <a href="minipage.html#minipage" accesskey="p" rel="prev">minipage</a>, Up: <a href="Environments.html#Environments" accesskey="u" rel="up">Environments</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="IndexDocument.html#Index" title="Index" rel="index">Index</a>]</p> 0117 </div> 0118 <hr> 0119 <a name="picture-1"></a> 0120 <h3 class="section">8.19 <code>picture</code></h3> 0121 0122 <a name="index-environment_002c-picture"></a> 0123 <a name="index-picture-environment"></a> 0124 0125 <a name="index-creating-pictures"></a> 0126 <a name="index-pictures_002c-creating"></a> 0127 0128 <p>Synopses: 0129 </p><div class="example"> 0130 <pre class="example">\begin{picture}(<var>width</var>,<var>height</var>) 0131 <var>picture commands</var> 0132 \end{picture} 0133 </pre></div> 0134 0135 <p>or 0136 </p> 0137 <div class="example"> 0138 <pre class="example">\begin{picture}(<var>width</var>,<var>height</var>)(<var>xoffset</var>,<var>yoffset</var>) 0139 <var>picture commands</var> 0140 \end{picture} 0141 </pre></div> 0142 0143 <p>An environment to create simple pictures containing lines, arrows, 0144 boxes, circles, and text. Note that while this environment is not 0145 obsolete, new documents typically use much more powerful graphics 0146 creation systems, such as <code>TikZ</code>, <code>PSTricks</code>, <code>MetaPost</code>, 0147 or <code>Asymptote</code>. These are not covered in this document; see CTAN. 0148 </p> 0149 <p>This shows the parallelogram law for adding vectors. 0150 </p> 0151 <a name="index-_005cunitlength"></a> 0152 <div class="example"> 0153 <pre class="example">\setlength{\unitlength}{1cm} 0154 \begin{picture}(6,6) % picture box will be 6cm wide by 6cm tall 0155 \put(0,0){\vector(2,1){4}} % for every 2 over this vector goes 1 up 0156 \put(2,1){\makebox(0,0)[l]{\ first leg}} 0157 \put(4,2){\vector(1,2){2}} 0158 \put(5,4){\makebox(0,0)[l]{\ second leg}} 0159 \put(0,0){\line(1,1){6}} 0160 \put(3,3){\makebox(0,0)[r]{sum\ }} 0161 \end{picture} 0162 </pre></div> 0163 0164 <p>You can also use this environment to place arbitrary material at an 0165 exact location. 0166 </p> 0167 <div class="example"> 0168 <pre class="example">\usepackage{color,graphicx} % in preamble 0169 ... 0170 \begin{center} 0171 \setlength{\unitlength}{\textwidth} 0172 \begin{picture}(1,1) % leave space, \textwidth wide and tall 0173 \put(0,0){\includegraphics[width=\textwidth]{desertedisland.jpg}} 0174 \put(0.25,0.35){\textcolor{red}{X Treasure here}} 0175 \end{picture} 0176 \end{center} 0177 </pre></div> 0178 0179 <p>The red X will be precisely a quarter of the <code>\linewidth</code> from 0180 the left margin, and <code>0.35\linewidth</code> up from the bottom. Another 0181 example of this usage is to put similar code in the page header to get 0182 repeat material on each of a document’s pages. 0183 </p> 0184 <p>The <code>picture</code> environment has one required argument, a pair of 0185 numbers (<var>width</var>,<var>height</var>). Multiply these by the value 0186 <code>\unitlength</code> to get the nominal size of the output, the space that 0187 LaTeX reserves on the output page. This nominal size need not be how 0188 large the picture really is; LaTeX will draw things from the picture 0189 outside the picture’s box. 0190 </p> 0191 <p>This environment also has an optional argument 0192 (<var>xoffset</var>,<var>yoffset</var>). It is used to shift the origin. Unlike 0193 most optional arguments, this one is not contained in square brackets. 0194 As with the required argument, it consists of two real numbers. 0195 Multiply these by <code>\unitlength</code> to get the point at the lower-left 0196 corner of the picture. 0197 </p> 0198 <p>For example, if <code>\unitlength</code> has been set to <code>1mm</code>, the 0199 command 0200 </p> 0201 <div class="example"> 0202 <pre class="example">\begin{picture}(100,200)(10,20) 0203 </pre></div> 0204 0205 <p>produces a box of width 100 millimeters and height 200 millimeters. The 0206 picture’s origin is the point (10mm,20mm) and so the lower-left corner 0207 is there, and the upper-right corner is at (110mm,220mm). When you 0208 first draw a picture you typically omit the optional argument, leaving 0209 the origin at the lower-left corner. If you then want to modify your 0210 picture by shifting everything, you can just add the appropriate 0211 optional argument. 0212 </p> 0213 <a name="index-position_002c-in-picture"></a> 0214 <p>Each <var>picture command</var> tells LaTeX where to put something by 0215 naming its position. A <em>position</em> is a pair such as <code>(2.4,-5)</code> 0216 giving the x- and y-coordinates. A <em>coordinate</em> is a not a length, 0217 it is a real number (it may have a decimal point or a minus sign). It 0218 specifies a length in multiples of the unit length <code>\unitlength</code>, 0219 so if <code>\unitlength</code> has been set to <code>1cm</code>, then the coordinate 0220 2.54 specifies a length of 2.54 centimeters. 0221 </p> 0222 <p>LaTeX’s default for <code>\unitlength</code> is <code>1pt</code>. it is a rigid 0223 length (see <a href="Lengths.html#Lengths">Lengths</a>). Change it with the <code>\setlength</code> command 0224 (see <a href="_005csetlength.html#g_t_005csetlength">\setlength</a>). Make this change only outside of a <code>picture</code> 0225 environment. 0226 </p> 0227 <p>Coordinates are given with respect to an origin, which is normally at 0228 the lower-left corner of the picture. Note that when a position appears 0229 as an argument, as with <code>\put(1,2){...}</code>, it is not enclosed in 0230 braces since the parentheses serve to delimit the argument. Also, 0231 unlike in some computer graphics systems, larger y-coordinates are 0232 further up the page. 0233 </p> 0234 <p>There are four ways to put things in a picture: <code>\put</code>, 0235 <code>\multiput</code>, <code>\qbezier</code>, and <code>\graphpaper</code>. The most 0236 often used is <code>\put</code>. This 0237 </p> 0238 <div class="example"> 0239 <pre class="example">\put(11.3,-0.3){...} 0240 </pre></div> 0241 0242 <p>places the object with its reference point at coordinates 0243 <em>(11.3,-0.3)</em>. The reference points for various objects will be 0244 described below. 0245 <a name="index-LR-box"></a> 0246 The <code>\put</code> command creates an <em>LR box</em> (see <a href="Modes.html#Modes">Modes</a>). 0247 Anything that can go in an <code>\mbox</code> (see <a href="_005cmbox-_0026-_005cmakebox.html#g_t_005cmbox-_0026-_005cmakebox">\mbox & \makebox</a>) can 0248 go in the text argument of the <code>\put</code> command. The reference point 0249 will be the lower left corner of the box. In this picture 0250 </p> 0251 <div class="example"> 0252 <pre class="example">\setlength{\unitlength}{1cm} 0253 ...\begin{picture}(1,1) 0254 \put(0,0){\line(1,0){1}} 0255 \put(0,0){\line(1,1){1}} 0256 \end{picture} 0257 </pre></div> 0258 0259 <p>the three dots are just slightly left of the point of the angle formed 0260 by the two lines. (Also, <code>\line(1,1){1}</code> does not call for a 0261 line of length one; rather the line has a change in the x coordinate of 0262 1.) 0263 </p> 0264 <p>The <code>\multiput</code>, <code>qbezier</code>, and <code>graphpaper</code> commands are 0265 described below. 0266 </p> 0267 <p>This draws a rectangle with a wavy top, using <code>\qbezier</code> for 0268 that curve. 0269 </p> 0270 <div class="example"> 0271 <pre class="example">\begin{picture}(3,1.5) 0272 \put(0,0){\vector(1,0){8}} % x axis 0273 \put(0,0){\vector(0,1){4}} % y axis 0274 \put(2,0){\line(0,1){3}} % left side rectangle 0275 \put(4,0){\line(0,1){3.5}} % right side 0276 \qbezier(2,3)(2.5,2.9)(3,3.25) 0277 \qbezier(3,3.25)(3.5,3.6)(4,3.5) 0278 \thicklines % below here, lines are twice as thick 0279 \put(2,3){\line(4,1){2}} 0280 \put(4.5,2.5){\framebox{Trapezoidal Rule}} 0281 \end{picture} 0282 </pre></div> 0283 0284 <table class="menu" border="0" cellspacing="0"> 0285 <tr><td align="left" valign="top">• <a href="_005cput.html#g_t_005cput" accesskey="1">\put</a>:</td><td> </td><td align="left" valign="top">Place an object at a specified place. 0286 </td></tr> 0287 <tr><td align="left" valign="top">• <a href="_005cmultiput.html#g_t_005cmultiput" accesskey="2">\multiput</a>:</td><td> </td><td align="left" valign="top">Draw multiple instances of an object. 0288 </td></tr> 0289 <tr><td align="left" valign="top">• <a href="_005cqbezier.html#g_t_005cqbezier" accesskey="3">\qbezier</a>:</td><td> </td><td align="left" valign="top">Draw a quadratic Bezier curve. 0290 </td></tr> 0291 <tr><td align="left" valign="top">• <a href="_005cgraphpaper.html#g_t_005cgraphpaper" accesskey="4">\graphpaper</a>:</td><td> </td><td align="left" valign="top">Draw graph paper. 0292 </td></tr> 0293 <tr><td align="left" valign="top">• <a href="_005cline.html#g_t_005cline" accesskey="5">\line</a>:</td><td> </td><td align="left" valign="top">Draw a straight line. 0294 </td></tr> 0295 <tr><td align="left" valign="top">• <a href="_005clinethickness.html#g_t_005clinethickness" accesskey="6">\linethickness</a>:</td><td> </td><td align="left" valign="top">Set thickness of horizontal and vertical lines. 0296 </td></tr> 0297 <tr><td align="left" valign="top">• <a href="_005cthinlines.html#g_t_005cthinlines" accesskey="7">\thinlines</a>:</td><td> </td><td align="left" valign="top">The default line thickness. 0298 </td></tr> 0299 <tr><td align="left" valign="top">• <a href="_005cthicklines.html#g_t_005cthicklines" accesskey="8">\thicklines</a>:</td><td> </td><td align="left" valign="top">A heavier line thickness. 0300 </td></tr> 0301 <tr><td align="left" valign="top">• <a href="_005ccircle.html#g_t_005ccircle" accesskey="9">\circle</a>:</td><td> </td><td align="left" valign="top">Draw a circle. 0302 </td></tr> 0303 <tr><td align="left" valign="top">• <a href="_005coval.html#g_t_005coval">\oval</a>:</td><td> </td><td align="left" valign="top">Draw an oval. 0304 </td></tr> 0305 <tr><td align="left" valign="top">• <a href="_005cshortstack.html#g_t_005cshortstack">\shortstack</a>:</td><td> </td><td align="left" valign="top">Make a stack of objects. 0306 </td></tr> 0307 <tr><td align="left" valign="top">• <a href="_005cvector.html#g_t_005cvector">\vector</a>:</td><td> </td><td align="left" valign="top">Draw a line with an arrow. 0308 </td></tr> 0309 <tr><td align="left" valign="top">• <a href="_005cmakebox-_0028picture_0029.html#g_t_005cmakebox-_0028picture_0029">\makebox (picture)</a>:</td><td> </td><td align="left" valign="top">Draw a box of the specified size. 0310 </td></tr> 0311 <tr><td align="left" valign="top">• <a href="_005cframebox-_0028picture_0029.html#g_t_005cframebox-_0028picture_0029">\framebox (picture)</a>:</td><td> </td><td align="left" valign="top">Draw a box with a frame around it. 0312 </td></tr> 0313 <tr><td align="left" valign="top">• <a href="_005cframe.html#g_t_005cframe">\frame</a>:</td><td> </td><td align="left" valign="top">Draw a frame around an object. 0314 </td></tr> 0315 <tr><td align="left" valign="top">• <a href="_005cdashbox.html#g_t_005cdashbox">\dashbox</a>:</td><td> </td><td align="left" valign="top">Draw a dashed box. 0316 </td></tr> 0317 </table> 0318 0319 0320 0321 0322 <hr/><div class='referenceinfo'> <a href='https://latexref.xyz/'> <i>Unofficial LaTeX2e reference manual</i></a></div> 0323 </body> 0324 </html>