| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!-- |
| 3 |
This file is part of groff, the GNU roff type-setting system. |
| 4 |
|
| 5 |
Copyright (C) 2004-2020 Free Software Foundation, Inc. |
| 6 |
Written by Peter Schaffter ([email protected]). |
| 7 |
|
| 8 |
Permission is granted to copy, distribute and/or modify this document |
| 9 |
under the terms of the GNU Free Documentation License, Version 1.3 or |
| 10 |
any later version published by the Free Software Foundation; with no |
| 11 |
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover |
| 12 |
Texts. |
| 13 |
|
| 14 |
A copy of the Free Documentation License is included as a file called |
| 15 |
FDL in the main directory of the groff source package. |
| 16 |
--> |
| 17 |
|
| 18 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 19 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 20 |
|
| 21 |
<head> |
| 22 |
<meta http-equiv="content-type" content="text/html;charset=utf-8"/> |
| 23 |
<title>Mom -- Graphical Objects</title> |
| 24 |
<link rel="stylesheet" type="text/css" href="stylesheet.css" /> |
| 25 |
</head> |
| 26 |
|
| 27 |
<body style="background-color: #f5faff;"> |
| 28 |
|
| 29 |
<!-- ==================================================================== --> |
| 30 |
|
| 31 |
<div id="top" class="page"> |
| 32 |
|
| 33 |
<!-- Navigation links --> |
| 34 |
<table style="width: 100%;"> |
| 35 |
<tr> |
| 36 |
<td><a href="toc.html">Back to Table of Contents</a></td> |
| 37 |
<td style="text-align: right;"><a href="docprocessing.html#top">Next: Document processing</a></td> |
| 38 |
</tr> |
| 39 |
</table> |
| 40 |
|
| 41 |
<h1 class="docs">Graphical objects</h1> |
| 42 |
|
| 43 |
<div style="text-align: center;"> |
| 44 |
<ul class="no-enumerator" style="margin-left: -2.5em;"> |
| 45 |
<li><a href="#intro-graphical">Introduction to graphical objects</a></li> |
| 46 |
<li><a href="#behaviour">Graphical objects behaviour</a></li> |
| 47 |
<li><a href="#order">Order of arguments</a></li> |
| 48 |
<li><a href="#index-graphical">Index of graphical objects macros</a></li> |
| 49 |
</ul> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div class="rule-medium"><hr/></div> |
| 53 |
|
| 54 |
<h2 id="intro-graphical" class="docs">Introduction to graphical objects</h2> |
| 55 |
|
| 56 |
<p> |
| 57 |
Groff has a number of |
| 58 |
<a href="definitions.html#inlines">inline escapes</a> |
| 59 |
for drawing rules, polygons, ellipses and splines. All begin with |
| 60 |
<kbd>\D</kbd> (presumably for “Draw”) and are documented |
| 61 |
in the groff info manual: |
| 62 |
<br/> |
| 63 |
<span class="pre-in-pp"> |
| 64 |
info groff \D |
| 65 |
</span> |
| 66 |
The escapes allow you to draw just about any simple graphical object |
| 67 |
you can think of, but owing to their syntax they’re not always easy |
| 68 |
to read, which can make tweaking them difficult. Additionally, |
| 69 |
while they perform in a <i>consistent</i> manner, they don’t |
| 70 |
always perform in an <i>expected</i> manner. |
| 71 |
</p> |
| 72 |
|
| 73 |
<p> |
| 74 |
Experience shows that the most common graphical elements typesetters |
| 75 |
need are rules (horizontal and vertical), boxes, and circles (or |
| 76 |
ellipses). For this reason, mom provides macros |
| 77 |
to draw these objects in an easy-to-understand way; the results are |
| 78 |
predictable, and mom’s syntax makes fixes or tweaks |
| 79 |
painless. |
| 80 |
</p> |
| 81 |
|
| 82 |
<p id="graphical-example"> |
| 83 |
For example, if you want to draw a 2-inch square outline box at the left |
| 84 |
margin using groff’s <kbd>\D</kbd> escapes, it looks like this: |
| 85 |
<br/> |
| 86 |
<span class="pre-in-pp"> |
| 87 |
back up |
| 88 |
by |
| 89 |
weight |
| 90 |
+-------+ |
| 91 |
| | |
| 92 |
\D't 500'\h'-500u'\D'p 2i 0 0 2i -2i 0 0 -2i' |
| 93 |
| | | | |
| 94 |
+-------+ +------------------------+ |
| 95 |
set rule draw box, 1 line at a time |
| 96 |
weight |
| 97 |
</span> |
| 98 |
|
| 99 |
Obviously, this isn’t very efficient for something as simple as a |
| 100 |
box. |
| 101 |
</p> |
| 102 |
|
| 103 |
<p> |
| 104 |
Here’s the same box, drawn with mom’s box drawing |
| 105 |
macro |
| 106 |
<kbd><a href="#dbx">DBX</a></kbd>: |
| 107 |
<br/> |
| 108 |
<span class="pre-in-pp"> |
| 109 |
left margin indent--+ +--box width |
| 110 |
| | |
| 111 |
.DBX .5 0 2i 2i |
| 112 |
| | |
| 113 |
rule weight--+ +--box depth |
| 114 |
(in points) |
| 115 |
</span> |
| 116 |
</p> |
| 117 |
|
| 118 |
<p> |
| 119 |
Mom’s graphical object macros allow—in fact, |
| 120 |
require—giving the rule weight (“thickness”) for |
| 121 |
the object (or saying that you want it filled), an indent from the |
| 122 |
left margin where the object begins, the dimensions of the object, |
| 123 |
and optionally a colour for the object. |
| 124 |
</p> |
| 125 |
|
| 126 |
<p> |
| 127 |
There are no defaults for the arguments to mom’s graphical |
| 128 |
object macros, which means you must supply the arguments every time |
| 129 |
you invoke them. |
| 130 |
</p> |
| 131 |
|
| 132 |
<div class="box-tip"> |
| 133 |
<p class="tip"> |
| 134 |
<span class="note">Note:</span> |
| 135 |
As stated above, mom only provides macros for commonly-used |
| 136 |
graphical objects (rules, boxes, circles). More complex objects |
| 137 |
(polygons, non-straight lines, splines) must be drawn using |
| 138 |
groff’s <kbd>\D</kbd> escapes. |
| 139 |
</p> |
| 140 |
</div> |
| 141 |
|
| 142 |
<h3 id="behaviour" class="docs">Graphical object behaviour</h3> |
| 143 |
|
| 144 |
<p> |
| 145 |
Mom’s graphical object macros all behave in the following, |
| 146 |
carved-in-stone ways: |
| 147 |
</p> |
| 148 |
<ol style="margin-top: -.5em; margin-bottom: -.5em;"> |
| 149 |
<li>Objects are drawn from the |
| 150 |
<a href="definitions.html#baseline">baseline</a> |
| 151 |
down, including horizontal rules.</li> |
| 152 |
<li>Objects begin precisely at the left indent supplied as |
| 153 |
an argument to the macro.</li> |
| 154 |
<li>Objects are drawn from left to right.</li> |
| 155 |
<li>Enclosed objects (boxes, circles) are drawn from the |
| 156 |
perimeter <i>inward</i>.</li> |
| 157 |
<li>Objects return to their horizontal/vertical point of origin.</li> |
| 158 |
</ol> |
| 159 |
|
| 160 |
<p> |
| 161 |
The consistency means that once you’ve mastered the very |
| 162 |
simple order of arguments that applies to invoking graphical |
| 163 |
object macros, you can draw objects with full confidence that you |
| 164 |
know exactly where they’re placed and how much room they |
| 165 |
occupy. Furthermore, because all return to their point of origin, |
| 166 |
you’ll know exactly where you are on the page. |
| 167 |
</p> |
| 168 |
|
| 169 |
<h3 id="order" class="docs">Order of arguments</h3> |
| 170 |
|
| 171 |
<p> |
| 172 |
The order of arguments to the graphical object macros is the same |
| 173 |
for every macro: |
| 174 |
</p> |
| 175 |
<ul style="margin-top: -.5em; margin-bottom: -.5em;"> |
| 176 |
<li>the rule weight |
| 177 |
<ul style="margin-left: -.75em;"> |
| 178 |
<li>the single word <kbd>SOLID</kbd> may be used in place |
| 179 |
of <kbd>weight</kbd> if you want boxes or circles filled</li> |
| 180 |
</ul></li> |
| 181 |
<li>the indent from the current left margin at which to begin |
| 182 |
the object |
| 183 |
</li> |
| 184 |
<li>the width of the object if applicable</li> |
| 185 |
<li>the depth of the object if applicable</li> |
| 186 |
<li>the colour of the object (optional)</li> |
| 187 |
</ul> |
| 188 |
|
| 189 |
<div class="macro-list-container"> |
| 190 |
<h3 id="index-graphical" class="macro-list">Graphical objects macros</h3> |
| 191 |
|
| 192 |
<ul class="macro-list"> |
| 193 |
<li><a href="#drh">DRH</a> |
| 194 |
– horizontal rules</li> |
| 195 |
<li><a href="#drv">DRV</a> |
| 196 |
– vertical rules</li> |
| 197 |
<li><a href="#dbx">DBX</a> |
| 198 |
– box</li> |
| 199 |
<li><a href="#dcl">DCL</a> |
| 200 |
– circles or ellipses</li> |
| 201 |
</ul> |
| 202 |
</div> |
| 203 |
|
| 204 |
<!-- -DRH- --> |
| 205 |
|
| 206 |
<div class="macro-id-overline"> |
| 207 |
<h3 id="drh" class="macro-id">Drawing horizontal rules</h3> |
| 208 |
</div> |
| 209 |
|
| 210 |
<div class="box-macro-args"> |
| 211 |
Macro: <b>DRH</b> <kbd class="macro-args"><none> | <weight> <indent> <width> [<colour>]</kbd> |
| 212 |
</div> |
| 213 |
|
| 214 |
<p class="requires"> |
| 215 |
• |
| 216 |
the argument to <kbd class="normal"><weight></kbd> is in |
| 217 |
<a href="definitions.html#picaspoints" class="normal">points</a>, |
| 218 |
but do <span class="normal">not</span> append the |
| 219 |
<a href="definitions.html#unitsofmeasure">unit of measure</a>, |
| 220 |
<kbd class="normal">p</kbd> |
| 221 |
<br/> |
| 222 |
• |
| 223 |
<kbd class="normal"><indent></kbd> |
| 224 |
and |
| 225 |
<kbd class="normal"><width></kbd> |
| 226 |
require a unit of measure |
| 227 |
<br/> |
| 228 |
• |
| 229 |
arithmetic expressions to |
| 230 |
<kbd class="normal"><indent></kbd> |
| 231 |
and |
| 232 |
<kbd class="normal"><width></kbd> |
| 233 |
must be surrounded by parentheses |
| 234 |
</p> |
| 235 |
|
| 236 |
<p> |
| 237 |
If all you want is to draw a rule from your current left |
| 238 |
margin to your current right margin (in other words, a "full |
| 239 |
measure" rule), you may invoke <kbd>.DRH</kbd> without any |
| 240 |
arguments. |
| 241 |
</p> |
| 242 |
<div class="box-tip"> |
| 243 |
<p class="tip"> |
| 244 |
<span class="note">Note:</span> |
| 245 |
DRH is the only graphical object macro that may be invoked |
| 246 |
without arguments. The weight (“thickness”) of |
| 247 |
the rule is determined by the argument you last gave the |
| 248 |
macro |
| 249 |
<a href="inlines.html#rule-weight">RULE_WEIGHT</a>. |
| 250 |
DRH, used this way, is exactly equivalent to entering the |
| 251 |
<a href="definitions.html#inlines">inline escape</a> |
| 252 |
<a href="inlines.html#inline-rule-mom"><kbd><span class="nobr">\*[RULE]</span></kbd></a>. |
| 253 |
</p> |
| 254 |
</div> |
| 255 |
|
| 256 |
<p style="margin-top: -.5em;"> |
| 257 |
To draw horizontal rules of a specified width, you must, at |
| 258 |
a minimum, supply DRH with the arguments <kbd>weight,</kbd> |
| 259 |
<kbd>indent</kbd> (measured from the current left margin) and |
| 260 |
<kbd>width</kbd>. |
| 261 |
</p> |
| 262 |
|
| 263 |
<p> |
| 264 |
Optionally, you may give a <kbd>color</kbd> argument. The colour |
| 265 |
may be either one defined with |
| 266 |
<a href="color.html#newcolor">NEWCOLOR</a>, |
| 267 |
or a named X-color initialized with |
| 268 |
<a href="color.html#xcolor">XCOLOR</a>, |
| 269 |
or an X-color alias (again, initialized with XCOLOR). |
| 270 |
</p> |
| 271 |
|
| 272 |
<p> |
| 273 |
Say, for example, you want to draw a 1-1/4 point horizontal rule |
| 274 |
that starts 2 picas from the current left margin and runs for 3 |
| 275 |
inches. To do so, you’d invoke <kbd>.DRH</kbd> like this: |
| 276 |
<br/> |
| 277 |
<span class="pre-in-pp"> |
| 278 |
weight width |
| 279 |
| | |
| 280 |
.DRH 1.25 2P 3i |
| 281 |
| |
| 282 |
indent |
| 283 |
</span> |
| 284 |
(Note that the rule weight argument, which is expressed in points, |
| 285 |
must not have the unit of measure <kbd>p</kbd> appended to it.) |
| 286 |
</p> |
| 287 |
|
| 288 |
<p> |
| 289 |
If, in addition, you want the rule blue: |
| 290 |
<br/> |
| 291 |
<span class="pre-in-pp"> |
| 292 |
.DRH 1.25 2P 3i blue |
| 293 |
</span> |
| 294 |
</p> |
| 295 |
|
| 296 |
<h3 class="docs">How mom handles the positioning of horizontal rules</h3> |
| 297 |
|
| 298 |
<p> |
| 299 |
Horizontal rules are drawn from left to right, and from the baseline |
| 300 |
down. “From the baseline down” means that if you request |
| 301 |
a rule with a weight of four points, the four points of rule fall |
| 302 |
entirely below the baseline. |
| 303 |
</p> |
| 304 |
|
| 305 |
<p> |
| 306 |
Furthermore, after the rule is drawn, mom returns you to the current |
| 307 |
left margin, at the same vertical position on the page as when DRH |
| 308 |
was invoked. In other words, DRH causes no movement on the page, |
| 309 |
either horizontal or vertical. |
| 310 |
</p> |
| 311 |
|
| 312 |
<!-- -DRV- --> |
| 313 |
|
| 314 |
<div class="macro-id-overline"> |
| 315 |
<h3 id="drv" class="macro-id">Drawing vertical rules</h3> |
| 316 |
</div> |
| 317 |
|
| 318 |
<div class="box-macro-args"> |
| 319 |
Macro: <b>DRV</b> <kbd class="macro-args"><weight> <indent> <depth> [<colour>]</kbd> |
| 320 |
</div> |
| 321 |
|
| 322 |
<p class="requires"> |
| 323 |
• |
| 324 |
the argument to <kbd class="normal"><weight></kbd> is in |
| 325 |
<a href="definitions.html#picaspoints" class="normal">points</a>, |
| 326 |
but do <span class="normal">not</span> append the |
| 327 |
<a href="definitions.html#unitsofmeasure">unit of measure</a>, |
| 328 |
<kbd class="normal">p</kbd> |
| 329 |
<br/> |
| 330 |
• |
| 331 |
<kbd class="normal"><indent></kbd> |
| 332 |
and |
| 333 |
<kbd class="normal"><depth></kbd> |
| 334 |
require a unit of measure |
| 335 |
<br/> |
| 336 |
• |
| 337 |
arithmetic expressions to |
| 338 |
<kbd class="normal"><indent></kbd> |
| 339 |
and |
| 340 |
<kbd class="normal"><depth></kbd> |
| 341 |
must be surrounded by parentheses |
| 342 |
</p> |
| 343 |
|
| 344 |
<p> |
| 345 |
To draw vertical rules of a specified depth, you must, at |
| 346 |
a minimum, supply DRV with the arguments <kbd>weight,</kbd> |
| 347 |
<kbd>indent</kbd> (measured from the current left margin) and |
| 348 |
<kbd>depth</kbd>. |
| 349 |
</p> |
| 350 |
|
| 351 |
<p> |
| 352 |
Optionally, you may give a <kbd>color</kbd> argument. The colour |
| 353 |
may be either one defined with |
| 354 |
<a href="color.html#newcolor">NEWCOLOR</a>, |
| 355 |
or a named X-color initialized with |
| 356 |
<a href="color.html#xcolor">XCOLOR</a>, |
| 357 |
or an X-color alias (again, initialized with XCOLOR). |
| 358 |
</p> |
| 359 |
|
| 360 |
<p> |
| 361 |
Say, for example, you want to draw a 3/4-point vertical rule that |
| 362 |
starts 19-1/2 picas from the current left margin and has a depth of |
| 363 |
6 centimetres. To do so, you’d invoke <kbd>.DRV</kbd> like |
| 364 |
this: |
| 365 |
<br/> |
| 366 |
<span class="pre-in-pp"> |
| 367 |
weight depth |
| 368 |
| | |
| 369 |
.DRV .75 19P+6p 6c |
| 370 |
| |
| 371 |
indent |
| 372 |
</span> |
| 373 |
(Note that the rule weight argument, which is expressed in points, |
| 374 |
must not have the unit of measure <kbd>p</kbd> appended to it.) |
| 375 |
</p> |
| 376 |
|
| 377 |
<p> |
| 378 |
If, in addition, you want the rule red: |
| 379 |
<br/> |
| 380 |
<span class="pre-in-pp"> |
| 381 |
.DRV .75 19P+6p 6c red |
| 382 |
</span> |
| 383 |
</p> |
| 384 |
|
| 385 |
<h3 class="docs">How mom handles the positioning of vertical rules</h3> |
| 386 |
|
| 387 |
<p> |
| 388 |
Vertical rules are drawn from the baseline down, and from left to |
| 389 |
right. "Left to right" means that if you request a rule |
| 390 |
with a weight of four points, the four points of rule fall entirely |
| 391 |
to the right of the indent given to DRV. |
| 392 |
</p> |
| 393 |
|
| 394 |
<p> |
| 395 |
Furthermore, after the rule is drawn, mom returns you to the current |
| 396 |
left margin, at the same vertical position on the page as when DRV |
| 397 |
was invoked. In other words, DRV causes no movement on the page, |
| 398 |
either horizontal or vertical. |
| 399 |
</p> |
| 400 |
|
| 401 |
<!-- -DBX- --> |
| 402 |
|
| 403 |
<div class="macro-id-overline"> |
| 404 |
<h3 id="dbx" class="macro-id">Drawing boxes</h3> |
| 405 |
</div> |
| 406 |
|
| 407 |
<div class="box-macro-args"> |
| 408 |
Macro: <b>DBX</b> <kbd class="macro-args"><weight>|SOLID <indent> <width>|FULL_MEASURE <depth> [<color>]</kbd> |
| 409 |
</div> |
| 410 |
|
| 411 |
<p class="requires"> |
| 412 |
• |
| 413 |
the argument to <kbd class="normal"><weight></kbd> is in |
| 414 |
<a href="definitions.html#picaspoints" class="normal">points</a>, |
| 415 |
but do <span class="normal">not</span> append the |
| 416 |
<a href="definitions.html#unitsofmeasure">unit of measure</a> |
| 417 |
<kbd class="normal">p</kbd> |
| 418 |
<br/> |
| 419 |
• <kbd class="normal"><indent></kbd>, |
| 420 |
<kbd class="normal"><width></kbd>, |
| 421 |
and |
| 422 |
<kbd class="normal"><depth></kbd> |
| 423 |
require a unit of measure |
| 424 |
<br/> |
| 425 |
• |
| 426 |
arithmetic expressions to |
| 427 |
<kbd class="normal"><indent></kbd>, |
| 428 |
<kbd class="normal"><width></kbd>, |
| 429 |
and |
| 430 |
<kbd class="normal"><depth></kbd> |
| 431 |
must be enclosed in parentheses. |
| 432 |
</p> |
| 433 |
|
| 434 |
<p> |
| 435 |
To draw boxes you must, at a minimum, supply DBX with the arguments |
| 436 |
<kbd>weight</kbd> or <kbd>SOLID</kbd>, <kbd>indent</kbd>, |
| 437 |
<kbd>width</kbd> or <kbd>FULL_MEASURE</kbd>, and <kbd>depth</kbd>. |
| 438 |
</p> |
| 439 |
|
| 440 |
<p> |
| 441 |
<kbd>weight</kbd> is the rule weight of outlined boxes, given in |
| 442 |
points but without the |
| 443 |
<a href="definitions.html#unitsofmeasure">unit of measure</a> |
| 444 |
<kbd>p</kbd> appended. |
| 445 |
</p> |
| 446 |
|
| 447 |
<p> |
| 448 |
If <kbd>SOLID</kbd> is given as the first argument, the box is |
| 449 |
filled rather than outlined and no <kbd>weight</kbd> argument should |
| 450 |
be supplied. |
| 451 |
</p> |
| 452 |
|
| 453 |
<p> |
| 454 |
<kbd>indent</kbd> is measured from the current left margin. If |
| 455 |
<kbd>FULL_MEASURE</kbd> is given, <kbd>indent</kbd> should be set to |
| 456 |
“0”. |
| 457 |
</p> |
| 458 |
|
| 459 |
<p> |
| 460 |
<kbd>width</kbd> is the width of the box with a |
| 461 |
<a href="definitions.html#unitsofmeasure">unit of measure</a> |
| 462 |
appended, caclculated from <kbd>indent</kbd> argument. |
| 463 |
</p> |
| 464 |
|
| 465 |
<p> |
| 466 |
If <kbd>FULL_MEASURE</kbd> is given instead of <kbd>width</kbd>, |
| 467 |
it circumvents having to calculate the width when left and/or right |
| 468 |
indents are in effect; mom draws the box from the current left |
| 469 |
margin to the current right margin. When no indents are in effect, |
| 470 |
<kbd>FULL_MEASURE</kbd> or <kbd>\n[.l]u</kbd>—the groff |
| 471 |
way of saying “the current line length”—have the |
| 472 |
same effect. |
| 473 |
</p> |
| 474 |
|
| 475 |
<p> |
| 476 |
Optionally, you may give a <kbd>color</kbd> argument. The colour |
| 477 |
may be either one defined with |
| 478 |
<a href="color.html#newcolor">NEWCOLOR</a>, |
| 479 |
or a named X-color initialized with |
| 480 |
<a href="color.html#xcolor">XCOLOR</a>, |
| 481 |
or an X-color alias (again, initialized with XCOLOR). |
| 482 |
</p> |
| 483 |
|
| 484 |
<p> |
| 485 |
Say, for example, you want to draw a 1/2 point outline box that |
| 486 |
starts one inch from the current left margin and has the dimensions |
| 487 |
12 picas x 6 picas. To do so, you’d invoke <kbd>.DBX</kbd> |
| 488 |
like this: |
| 489 |
<br/> |
| 490 |
<span class="pre-in-pp"> |
| 491 |
indent depth |
| 492 |
| | |
| 493 |
.DBX .5 1i 12P 6P |
| 494 |
| | |
| 495 |
weight width |
| 496 |
</span> |
| 497 |
(Note that the box weight argument, which is expressed in points, |
| 498 |
must not have the unit of measure <kbd>p</kbd> appended to it.) |
| 499 |
</p> |
| 500 |
|
| 501 |
<p> |
| 502 |
If you want the same box, but solid (“filled”) rather |
| 503 |
than drawn as an outline: |
| 504 |
<br/> |
| 505 |
<span class="pre-in-pp"> |
| 506 |
.DBX SOLID 1i 12P 6P |
| 507 |
</span> |
| 508 |
Additionally, if you want the box green: |
| 509 |
<br/> |
| 510 |
<span class="pre-in-pp"> |
| 511 |
.DBX .5 1i 12P 6P green |
| 512 |
</span> |
| 513 |
or |
| 514 |
<span class="pre-in-pp"> |
| 515 |
.DBX SOLID 1i 12P 6P green |
| 516 |
</span> |
| 517 |
</p> |
| 518 |
|
| 519 |
<h3 class="docs">How mom handles the positioning of boxes</h3> |
| 520 |
|
| 521 |
<p> |
| 522 |
Boxes are drawn from the baseline down, from left to right, and |
| 523 |
from the perimeter <i>inward</i>. “From the perimeter |
| 524 |
inward” means that if you request a box weight of six points, |
| 525 |
the 6-point rules used to draw the outline of the box fall entirely |
| 526 |
<i>within</i> the dimensions of the box. |
| 527 |
</p> |
| 528 |
|
| 529 |
<p> |
| 530 |
Furthermore, after the box is drawn, mom returns you to the current |
| 531 |
left margin, at the same vertical position on the page as when DBX |
| 532 |
was invoked. In other words, DBX causes no movement on the page, |
| 533 |
either horizontal or vertical. |
| 534 |
</p> |
| 535 |
|
| 536 |
<!-- -DCL- --> |
| 537 |
|
| 538 |
<div class="macro-id-overline"> |
| 539 |
<h3 id="dcl" class="macro-id">Drawing circles (ellipses)</h3> |
| 540 |
</div> |
| 541 |
|
| 542 |
<div class="box-macro-args"> |
| 543 |
Macro: <b>DCL</b> <kbd class="macro-args"><weight>|SOLID <indent> <width>|FULL_MEASURE <depth> [<color>]</kbd> |
| 544 |
</div> |
| 545 |
|
| 546 |
<p class="requires"> |
| 547 |
• |
| 548 |
the argument to <kbd class="normal"><weight></kbd> is in |
| 549 |
<a href="definitions.html#picaspoints" class="normal">points</a>, |
| 550 |
but do <span class="normal">not</span> append the |
| 551 |
<a href="definitions.html#unitsofmeasure">unit of measure</a> |
| 552 |
<kbd class="normal">p</kbd> |
| 553 |
<br/> |
| 554 |
• <kbd class="normal"><indent></kbd>, |
| 555 |
<kbd class="normal"><width></kbd>, |
| 556 |
and |
| 557 |
<kbd class="normal"><depth></kbd> |
| 558 |
require a unit of measure |
| 559 |
<br/> |
| 560 |
• |
| 561 |
arithmetic expressions to |
| 562 |
<kbd class="normal"><indent></kbd>, |
| 563 |
<kbd class="normal"><width></kbd>, |
| 564 |
and |
| 565 |
<kbd class="normal"><depth></kbd> |
| 566 |
must be enclosed in parentheses. |
| 567 |
</p> |
| 568 |
|
| 569 |
<p> |
| 570 |
To draw circles you must, at a minimum, supply DCL with the arguments |
| 571 |
<kbd>weight</kbd> or <kbd>SOLID</kbd>, <kbd>indent</kbd>, |
| 572 |
<kbd>width</kbd> or <kbd>FULL_MEASURE</kbd>, and <kbd>depth</kbd>. |
| 573 |
</p> |
| 574 |
|
| 575 |
<p> |
| 576 |
<kbd>weight</kbd> is the rule weight of outlined circles, given in |
| 577 |
points but without the unit of measure |
| 578 |
<a href="definitions.html#unitsofmeasure">unit of measure</a> |
| 579 |
<kbd>p</kbd> appended. |
| 580 |
</p> |
| 581 |
|
| 582 |
<p> |
| 583 |
If <kbd>SOLID</kbd> is given as the first argument, the circle is |
| 584 |
filled rather than outlined and no <kbd>weight</kbd> argument should |
| 585 |
be supplied. |
| 586 |
</p> |
| 587 |
|
| 588 |
<p> |
| 589 |
<kbd>indent</kbd> is measured from the current left margin. If |
| 590 |
<kbd>FULL_MEASURE</kbd> is given, <kbd>indent</kbd> should be set to |
| 591 |
“0”. |
| 592 |
</p> |
| 593 |
|
| 594 |
<p> |
| 595 |
<kbd>width</kbd> is the width of the circle with a |
| 596 |
<a href="definitions.html#unitsofmeasure">unit of measure</a> |
| 597 |
appended, caclculated from <kbd>indent</kbd> argument. |
| 598 |
</p> |
| 599 |
|
| 600 |
<p> |
| 601 |
If <kbd>FULL_MEASURE</kbd> is given instead of <kbd>width</kbd>, |
| 602 |
it circumvents having to calculate the width when left and/or right |
| 603 |
indents are in effect; mom draws the circle from the current left |
| 604 |
margin to the current right margin. When no indents are in effect, |
| 605 |
<kbd>FULL_MEASURE</kbd> or <kbd>\n[.l]u</kbd>—the groff |
| 606 |
way of saying “the current line length”—have the |
| 607 |
same effect. |
| 608 |
</p> |
| 609 |
|
| 610 |
<p> |
| 611 |
Optionally, you may give a <kbd>color</kbd> argument. The colour |
| 612 |
may be either one defined with |
| 613 |
<a href="color.html#newcolor">NEWCOLOR</a>, |
| 614 |
or a named X-color initialized with |
| 615 |
<a href="color.html#xcolor">XCOLOR</a>, |
| 616 |
or an X-color alias (again, initialized with XCOLOR). |
| 617 |
</p> |
| 618 |
|
| 619 |
<p> |
| 620 |
Say, for example, you want to draw a 1/2 point outline circle that |
| 621 |
starts one inch from the current left margin and has the dimensions |
| 622 |
12 picas x 6 picas. To do so, you’d invoke <kbd>.DCL</kbd> |
| 623 |
like this: |
| 624 |
<br/> |
| 625 |
<span class="pre-in-pp"> |
| 626 |
indent depth |
| 627 |
| | |
| 628 |
.DCL .5 1i 12P 6P |
| 629 |
| | |
| 630 |
weight width |
| 631 |
</span> |
| 632 |
(Note that the circle weight argument, which is expressed in points, |
| 633 |
must not have the unit of measure <kbd>p</kbd> appended to it.) |
| 634 |
</p> |
| 635 |
|
| 636 |
<p> |
| 637 |
If you want the same circle, but solid (“filled”) rather |
| 638 |
than drawn as an outline: |
| 639 |
<br/> |
| 640 |
<span class="pre-in-pp"> |
| 641 |
.DCL SOLID 1i 12P 6P |
| 642 |
</span> |
| 643 |
Additionally, if you want the circle green: |
| 644 |
<br/> |
| 645 |
<span class="pre-in-pp"> |
| 646 |
.DCL .5 1i 12P 6P green |
| 647 |
</span> |
| 648 |
or |
| 649 |
<span class="pre-in-pp"> |
| 650 |
.DCL SOLID 1i 12P 6P green |
| 651 |
</span> |
| 652 |
</p> |
| 653 |
|
| 654 |
|
| 655 |
<h3 class="docs">How mom handles the positioning of circles (ellipses)</h3> |
| 656 |
|
| 657 |
<p> |
| 658 |
Circles (ellipses) are drawn from the baseline down, from left |
| 659 |
to right, and from the perimeter <i>inward</i>. “From the |
| 660 |
perimeter inward” means that if you request a circle weight of |
| 661 |
six points, the 6-point rule used to draw the outline of the circle |
| 662 |
or ellipse falls entirely <i>within</i> the dimensions of the |
| 663 |
circle or ellipse. |
| 664 |
</p> |
| 665 |
|
| 666 |
<p> |
| 667 |
Furthermore, after the circle is drawn, mom returns you to the |
| 668 |
current left margin, at the same vertical position on the page as |
| 669 |
when DCL was invoked. In other words, DCL causes no movement on the |
| 670 |
page, either horizontal or vertical. |
| 671 |
</p> |
| 672 |
|
| 673 |
<div class="rule-long"><hr/></div> |
| 674 |
|
| 675 |
<!-- Navigation links --> |
| 676 |
<table style="width: 100%; margin-top: 12px;"> |
| 677 |
<tr> |
| 678 |
<td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td> |
| 679 |
<td style="width: 33%; text-align: center;"><a href="#top">Top</a></td> |
| 680 |
<td style="width: 33%; text-align: right;"><a href="docprocessing.html#top">Next: Document processing</a></td> |
| 681 |
</tr> |
| 682 |
</table> |
| 683 |
|
| 684 |
</div> |
| 685 |
|
| 686 |
<div class="bottom-spacer"><br/></div> |
| 687 |
|
| 688 |
</body> |
| 689 |
</html> |