12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

D. PICTURESthe point moves in the horizontal direction it will also have moved j units in the verticaldirection. Negative values for i or j have the expected meaning. A move of -3 units in imeans a move of 3 units to the left, and similarly a move of -4 units in j means a move of4 units downwards. So, a line sloping up to the right will have positive values for i and j,while a line sloping up to the left will have a negative value for i and a positive value forj.<strong>The</strong> 〈distance〉 argument specifies the length of the line in the x (horizontal) direction.One problem with this may have occured to you: what if the line is vertical (i.e., i = 0)?In this case only, 〈distance〉 specifies the vertical length of the line. <strong>The</strong> 〈distance〉 argumentmust be a non-negative value. For horizontal and vertical lines only, the actual length ofthe line is 〈distance〉. Figure D.2, which is produced from the code below, diagrams the linespecification arguments.\begin{figure}\centering\setlength{\unitlength}{1mm}\begin{picture}(70,60)\thicklines % draw line and ref point\put(10,20){\line(2,1){40}}\put(10,20){\vector(1,-1){0}}\thinlines % draw axes\put(0,0){\vector(1,0){60}} \put(63,0){x}\put(0,0){\vector(0,1){50}} \put(0,53){y}% draw i and j vectors\put(20,25){\vector(1,0){20}}\put(30,22){\makebox(0,0)[t]{$i$}}\put(40,25){\vector(0,1){10}}\put(42,30){\makebox(0,0)[l]{$j$}}% draw distance vector\put(30,10){\vector(-1,0){20}}\put(30,10){\vector(1,0){20}}\put(30,8){\makebox(0,0)[t]{\textit{distance}}}\end{picture}\setlength{\unitlength}{1pt}\caption{Specification of a line or arrow}\label{flpic:spec}\end{figure}Only a fixed number of slopes are available. This is because La<strong>TeX</strong> uses a special fontfor drawing lines — a line actually consists of little bits of angled rules joined together.Thus, there is only a limited number of values for i and j. <strong>The</strong>y must both be integers andin the range −6 ≤ i, j ≤ 6. Also, they must have no common divisor other than 1. In otherwords, the ratio between i and j must be in its simplest form. You cannot, for example,have (3, 6); instead it would have to be (1, 2). <strong>The</strong> shortest line that La<strong>TeX</strong> can draw isabout ten points (1/7 inch approximately) in overall length. You can, though, draw linesthat are too long to fit on the page.Figure D.3 shows the lines and arrows slanting upwards and to the right that can bedrawn in La<strong>TeX</strong>. <strong>The</strong> slope (i, j) pair are shown to the right of the first set of lines and418

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!