forked from jemmybutton/byrne-euclid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
byrne_euclid_man.tex
735 lines (512 loc) · 29.7 KB
/
byrne_euclid_man.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
\input preamble.tex
\setupindenting[medium,yes]
\starttext
\defineNewPicture{
}
\startchapter[title={Introduction}]
This document describes some of the internals of \MetaPost\ + \ConTeXt\ rendition of Byrne's Euclid.
Byrne's Euclid is known for its neat interaction between text and graphics. Naive way of making this interaction happen lies through lots of tedious manual work, which is not so tedious nowdays, but still we can hope to get off cheaper. To automate these things we need to set up same neat interaction between what we want to see and what we mean, as we want to have between text and graphics. I.~e., when we want to see a picture of a red angle in text, we mean not the color, but some particular angle, that is taken from some particular place, and if angle there changes color from red to blue, angle in text should also do so automatically.
One can think of many ways to achieve this. Among the simplest is introduction of some markup language that can both describe graphical elements and reference them in text, and that's precisely what *TeX and MetaPost pair should be ideal for.
The project consists of following files:
\startitemize
\item{\tt byrne.mp} — \MetaPost\ library responsible for handling graphics.
\item{\tt preamble.tex} — a bunch of \ConTeXt\ macros responsible for interaction between \MetaPost\ code and text.
\item{\tt preamble_be.tex} — \ConTeXt\ macros that are more book-specific and make little sense outside of the book.
\item{\tt byrne_context.tex} — \ConTeXt\ file with Byrne's book.
\item{\tt byrne_ru_context.tex} — \ConTeXt\ file with Russian translation Byrne's book.
\item{\tt type-ebgaramond-be.tex} — \ConTeXt\ typescript for EB Garamond typeface.
\item{\tt lettrines/lettrines.mp} — \MetaPost\ code that reads {\tt lettrines/lettrineslist.txt} generated by {\tt byrne_context.tex} or {\tt byrne_ru_context.tex} and produces lettrines.
\stopitemize
In order to generate the book pdf, simply run:
{\tt context byrne_context.tex}
That will produce a pdf file, but without generated lettrines. To obtain generated lettrines, run the following inside the lettrines folder.
{\tt mpost lettrines.mp}
Note that this should be done after {\tt context byrne_context.tex} first run, because {\tt lettrineslist.txt} produced in process contains list of lettrines, that will be generated.
After that, run {\tt context byrne_context.tex} again, to get a pdf with lettrines.
\stopchapter
\startchapter[title={\MetaPost\ part}]
All the drawing is done with \MetaPost. All the \MetaPost\ code is independent from \ConTeXt\ and can be used anywhere (e. g. with \LaTeX).
\startsection[title={Global variables}]
Some of the parameters are stored in global variables, instead of being passed as arguments, most important of them are listed below.
\startsubsection[title={scaleFactor}]
Numeric. All sizes are multiplied by {\tt scaleFactor}.
\stopsubsection
\startsubsection[title={angleScale}]
Numeric. Angles are generally drawn as circle sectors, and circle radii are multiplied by {\tt angleScale}.
\stopsubsection
\startsubsection[title={globalRotation}]
Numeric. All the pictures are rotated by {\tt globalRotation} angle. This is important when {\tt textLabels} are turned on.
\stopsubsection
\startsubsection[title={magnitudeScale}]
Numeric. Magnitude symbols are scaled according to {\tt magnitudeScale}.
\stopsubsection
\startsubsection[title={textLabels}]
Boolean. If true, text labels are produced.
\stopsubsection
\stopsection
\startsection[title={Lines}]
\startsubsection[title={byLineRender (expr a, b, col, dp, th, c, d, ct, dt, s, sf)}]
All functions that make straight lines call this one in the end. Returns a picture of a line with given properties.
{\tt a, b} — of pair type, coordinates of line ends.
{\tt col} — of color type, line color.
{\tt dp} — of numeric type, line dashedness. 0 for solid line, 1 for dashed.
{\tt th} — of numeric type, line thickness. 0 for thick line, 1 for thin, 2 for hairline, -1 for two-color thick line.
{\tt c, d} — of pair type, coordinates of distant ends of adjacent lines, to give line ands appropriate joint (when equal to {\tt a} or {\tt b} respectively, line ends are chopped straight).
{\tt ct, cd} — of numeric type, types of line end joints. 0 for miter joint, 1 for lap joint.
{\tt s} — of numeric type, perpendicular line shift, proportional to line thickness.
{\tt sf} — scale factor.
\stopsubsection
\startsubsection[title={byLineDefine@\#(suffix a, b) (expr col, dp, th)}]
Defines a new line. Automatically assigned name has a form of {\tt ab}. Returns nothing.
{@\#} — optional name.
{\tt a, b} — of suffix type, coordinates of line ends.
{\tt col, dp, th} — same as {\tt byLineRender}.
\stopsubsection
\startsubsection[title={byLineStylize (expr c, d, ct, dt, s) (suffix lineName)}]
Defines additional attributes for a line with a given name. Returns nothing.
{\tt lineName} — of suffix type, line name.
{\tt c, d, ct, dt, s} — same as {\tt byLineRender}.
\stopsubsection
\startsubsection[title={byLine@\#(suffix a, b) (expr col, dp, th)}]
Defines a new line. Automatically assigned name has a form of {\tt ab}. Returns a picture of that line.
{@\#} — optional name.
{\tt a, b, col, dp, th} — same as {\tt byLineDefine}.
\stopsubsection
\startsubsection[title={byLineFull@\#(suffix a, b) (expr col, dp, th, c, d, ct, dt, s)}]
Defines a new line with additional attributes. Automatically assigned name has a form of {\tt ab}. Returns a picture of that line.
{@\#} — optional name.
{\tt a, b, col, dp, th} — same as {\tt byLineDefine}.
{\tt c, d, ct, dt, s} — same as {\tt byLineRender}.
\stopsubsection
\startsubsection[title={byLineWithName (suffix a, b) (expr col, dp, th) (suffix
lineName)}]
Defines a new line with a given name. If labels are turned on, name is used as a label instead of labels on line ends. Returns a picture of that line.
{\tt a, b, col, dp, th} — same as {\tt byLineDefine}.
{\tt lineName} — of suffix type, line name.
\stopsubsection
\startsubsection[title={byNamedLineFull (expr c, d, ct, dt, s) (suffix lineName)}]
Produces already defined line with a given name, supplied with additional attributes. Returns a picture of that line.
{\tt lineName} — of suffix type, line name.
{\tt c, d, ct, dt, s} — same as {\tt byLineRender}.
\stopsubsection
\startsubsection[title={byNamedLine (text linesList)}]
Produces a number of already defined lines (separated by comma). Returnes a picture of that lines.
{\tt linesList} — of text type, comma separated line names.
\stopsubsection
\startsubsection[title={byNamedLineSeq (expr s) (text linesList)}]
Produces a number of already defined with appropriate joints for adjacent lines (separated by comma). All the lines can be shifted perpendicularly. Specified line shift is saved. Returnes a picture of that lines.
{\tt s} — of numeric type, as in {\tt byLineRender}, perpendicular line shift, proportional to line thickness, but s is not passed directly to {\tt byLineRender} (which can result in lines shifted in different directions along the sequence), but adjusted so, that lines are all shifted similarly.
{\tt linesList} — of text type, comma separated line names.
\stopsubsection
\startsubsection[title={byMarkLine (expr pos, col) (suffix lineName)}]
Produces a tick on a line with a given name. Returns a picture of that tick.
{\tt pos} — of numeric type, position of a tick on a line, 0 to 1.
{\tt col} — of color type, line color.
{\tt lineName} — of suffix type, line name.
\stopsubsection
\startsubsection[title={byNamedMarkLine (suffix lineName)}]
Produces a picture of a tick on a given line. Returns a picture of that tick.
{\tt lineName} — of suffix type, line name.
\stopsubsection
\startsubsection[title={byNamedCompoundLine(expr cu, pw) (text linesList)}]
Produces a horizontal line with colors and proportions of the given lines. Returns a picture of that line.
{\tt cu} — of numeric type, line length, which will be represented $1:1$.
{\tt pw} — of numeric type, power factor, which determines how strongly line length is changed to be closer to {\tt cu}. ${\tt cu}^{1-\frac{1}{\tt pw}} \times \sqrt[{\tt pw}]{length}$. If set to 0, all line will be forced to take length {\tt cu}.
{\tt linesList} — of text type, comma separated line names.
\stopsubsection
\stopsection
\startsection[title={Points}]
\startsubsection[title={byPointLabelDefine (suffix pointName)(expr t)}]
Defines text label for a point. Returns nothing.
{\tt pointName} — of suffix type, point name.
{\tt t} — of string type, text to used as point's label.
\stopsubsection
\startsubsection[title={byPointMarkRender (expr p, col, sty)}]
Renders a point marker. Returns a picture of that marker.
{\tt p} — of pair type, point coordinates.
{\tt col} — of color type, marker color.
{\tt sty} — of numeric type, marker style (currently not in use).
\stopsubsection
\startsubsection[title={byPointMarkDefine (suffix pointName)(expr col, sty)}]
Defines a new point marker. Returns nothing.
{\tt pointName} — of suffix type, point name to assign marker to.
{\tt col} — of color type, marker color.
{\tt sty} — of numeric type, marker style (currently not in use).
\stopsubsection
\startsubsection[title={byPointMark (suffix pointName)(expr col, sty)}]
Defines a new point marker. Returns a picture of that marker.
{\tt pointName, col, sty} — same as {\tt byPointMarkDefine}..
\stopsubsection
\startsubsection[title={byNamedPointMark (text pointsList)}]
Draws point markers with labels if necessary. Returns a picture of that marker.
{\tt pointsList} — of text type, comma separated point names.
\stopsubsection
\startsubsection[title={byNamedPointLines (suffix pointName)(expr omitLines)}]
Draws stubs of the lines, adjacent to a given point. Returns a picture of those lines.
{\tt pointName} — of suffix type, point name to draw lines for.
{\tt omitLines} — of string type, comma separated list of lines, that should be omitted.
\stopsubsection
\stopsection
\startsection[title={Arcs and circles}]
\startsubsection[title={byArcRender (expr o, b, e, r, col, dp, th, s, et)}]
All functions that make arcs and circles call this one in the end. Returns a picture of an arc with given properties.
{\tt o} — of pair type, coordinates of arc center.
{\tt b, e} — of numeric type, ends of an arc, in octants (well, not exactly, but fullcircle has length of eight and it's convenient to use arctime on fullcircle).
{\tt r} — of numeric type, arc radius.
{\tt col} — of color type, arc color
{\tt dp} — of numeric type, arc dashedness. 0 for solid line, 1 for dashed
{\tt th} — of numeric type, arc thickness. 0 for thick line, 1 for thin, 2 for hairline
{\tt s} — of numeric type, arc radius modifier, proportional to line thickness.
{\tt et} — of numeric type, type of arc ends, 0 for stumps, 1 for oblique
\stopsubsection
\startsubsection[title={byArcDefineBE@\#(suffix o)(expr b, e, r, col, dp, th, s, et)}]
Defines a new arc. Automatically assigned name has a form of {\tt o}. Returns nothing.
{@\#} — optional name.
{\tt o, b, e, r, col, dp, th, s, et} — same as {\tt byArcRender}.
\stopsubsection
\startsubsection[title={byArcBE@\#(suffix o)(expr b, e, r, col, dp, th, s, et)}]
Defines a new arc. Automatically assigned name has a form of {\tt o}. Returns a picture of that arc.
{@\#} — optional name.
{\tt o, b, e, r, col, dp, th, s, et} — same as {\tt byArcDefineBE}.
\stopsubsection
\startsubsection[title={byArcDefine@\#(suffix o, b, e) (r, col, dp, th, s, et)}]
Defines a new arc. Automatically assigned name has a form of {\tt boe}. Returns nothing.
{@\#} — optional name.
{\tt b} — of suffix type, point where arc begins.
{\tt e} — of suffix type, point where arc ends.
{\tt o, r, col, dp, th, s, et} — same as {\tt byArcRender}.
\stopsubsection
\startsubsection[title={byArc@\#(suffix o, b, e) (r, col, dp, th, s, et)}]
Defines a new arc. Automatically assigned name has a form of {\tt boe}. Returns a picture of that arc.
{@\#} — optional name.
{\tt b, e, o, r, col, dp, th, s, et} — same as {\tt byArcDefine}.
\stopsubsection
\startsubsection[title={byNamedArcExact(text arcslist)}]
Produces already defined arcs, including {\tt s} and {\tt et} paramters. Returns a picture of that arcs.
{\tt arcslist} — of text type, comma separated arc names.
\stopsubsection
\startsubsection[title={byNamedArc(text arcslist)}]
Produces already defined arcs, with {\tt s} and {\tt et} set to 0. Returns a picture of that arcs.
{\tt arcslist} — of text type, comma separated arc names.
\stopsubsection
\startsubsection[title={byCircleDefineR@\#(suffix o)(expr r, col, dp, th, s)}]
Defines a new circle. Automatically assigned name has a form of {\tt o}. Returns nothing.
{@\#} — optional name.
{\tt o} — of suffix type, circle center point.
{\tt r, col, dp, th, s} — same as {\tt byArcRender}.
\stopsubsection
\startsubsection[title={byCircleR@\#(suffix o)(exp r, col, dp, th, s)}]
Defines a new circle. Automatically assigned name has a form of {\tt o}. Returns a picture of that circle.
{@\#} — optional name.
{\tt o, r, col, dp, th, s} — same as {\tt byCircleDefineR}.
\stopsubsection
\startsubsection[title={byCircleABC@\#(suffix a, b, c)(expr col, dp, th, s)}]
Defines a new circle with a given name. Automatically assigned name has a form of {\tt abc}. Returns a picture of that circle.
{@\#} — optional name.
{\tt a, b, c} — of suffix type, points on circle citcumference.
{\tt col, dp, th, s} — same as {\tt byArcRender}.
\stopsubsection
\startsubsection[title={byCircle@\#(suffix o, a)(expr col, dp, th, s)}]
Defines a new circle with a given name. Automatically assigned name has a form of {\tt oa}. Returns a picture of that circle.
{@\#} — optional name.
{\tt col, dp, th, s} — same as {\tt byArcRender}.
{\tt a} — of suffix type, point on circle citcumference.
\stopsubsection
\startsubsection[title={byNamedCircle(text circlesList)}]
Produces already defined circles, with {\tt s} set to 0. Returns a picture of that circles.
{\tt circlesList} — of text type, comma separated circle names.
\stopsubsection
\stopsection
\startsection[title={Arbitrary figures}]
\startsubsection[title={byArbitraryFigureDefine@\#(expr p, col, dp, th)}]
Defines a new arbitrary path. Automatically assigned name is {\tt anArbitraryFigure} Returns nothing.
{@\#} — optional name.
{\tt p} — of path type, arbitrary path.
{\tt col} — of color type, path color.
{\tt dp} — of numeric type, path dashedness. 0 for solid line, 1 for dashed.
{\tt th} — of numeric type, path thickness. 0 for thick line, 1 for thin, 2 for hairline.
\stopsubsection
\startsubsection[title={byArbitraryFigure@\#(expr p, col, dp, th)}]
Defines a new arbitrary path. Automatically assigned name is {\tt anArbitraryFigure}. Returns a picture of that path.
{@\#} — optional name.
{\tt p, col, dp, th, arbitraryFigureName} — same as {\tt byArbitraryFigureDefine}.
\stopsubsection
\startsubsection[title={byNamedArbitraryFigure(text arbitraryFiguresList)}]
Produces already defined arbitrary figures. Returns a picture of that figures.
{\tt arbitraryFiguresList} — of text type, comma separated arbitrary figure names.
\stopsubsection
\stopsection
\startsection[title={Filled figures}]
\startsubsection[title={byFilledCircleSegment@\#(suffix o)(expr r, b, e, col)}]
Defines a new filled circle segment. Automatically assigned name has a form of {\tt o}. Returns a picture of that segment.
{@\#} — optional name.
{\tt o} — of pair type, coordinates of circle center.
{\tt r} — of numeric type, circle radius.
{\tt b, e} — of numeric type, ends of a segment, in octants.
{\tt col} — of color type, segment color
\stopsubsection
\startsubsection[title={byNamedFilledCircleSegment(text filledCircleSegmentList)}]
Produces already defined filled circle segment. Returns a picture of that segment.
{\tt filledCircleSegmentList} — of text type, comma separated circle segment names.
\stopsubsection
\startsubsection[title={byFilledCircleSector@\#(suffix o)(expr r, b, e, col)}]
Defines a new filled circle sector. Automatically assigned name has a form of {\tt o}. Returns a picture of that sector.
{@\#} — optional name.
{\tt o} — of pair type, coordinates of circle center.
{\tt r} — of numeric type, circle radius.
{\tt b, e} — of numeric type, ends of a sector, in octants.
{\tt col} — of color type, sector color
\stopsubsection
\startsubsection[title={byNamedFilledCircleSector(text filledCircleSectorList)}]
Produces already defined filled circle sector. Returns a picture of that sector.
{\tt filledCircleSectorList} — of text type, comma separated circle sector names.
\stopsubsection
\startsubsection[title={byPolygonDefine@\#(text pointsList)(expr col)}]
Defines a new filled polygon. Automatically assigned name has a form of {\tt abc...}. Returns nothing.
{@\#} — optional name.
{\tt pointsList} — of text type, comma separated point names.
{\tt col} — of color type, polygon color.
{\tt polygonName} — of suffix type, polygon name.
\stopsubsection
\startsubsection[title={byPolygon@\#(text pointsList)(expr col)}]
Defines a new filled polygon. Automatically assigned name has a form of {\tt abc...}. Returns a picture of that polygon.
Same as {\tt byPolygonDefine}.
\stopsubsection
\startsubsection[title={byNamedPolygon(text polygonsList)}]
Produces already defined filled polygon. Returns a picture of that polygon.
{\tt polygonsList} — of text type, comma separated polygon names.
\stopsubsection
\stopsection
\startsection[title={Angles}]
\startsubsection[title={byAngleDefine@\#(suffix a, b, c) (expr col, sty)}]
Defines a new angle. Automatically assigned name has a form of {\tt abc}. Returns nothing.
{@\#} — optional name.
{\tt a, b, c} — of suffix type, coordinates of angle points.
{\tt col} — of color type, angle color.
{\tt sty} — of numeric type, angle style, 0 for solid sector, 1 for arc, 2 for dashed arc.
\stopsubsection
\startsubsection[title={byAngle@\#(suffix a, b, c) (expr col, sty)}]
Defines a new angle. Automatically assigned name has a form of {\tt abc}. Returns a picture of that angle.
Dame as {\tt byAngleDefine}.
\stopsubsection
\startsubsection[title={byAngleExtended@\#(suffix a, b, c) (expr col, sty) (text optionalColors)}]
Defines a new angle with additional colors. Automatically assigned name has a form of {\tt abc}. Returns a picture of that angle.
{@\#} — optional name.
{\tt optionalColors} — of text type, a list of additional colors (currently only affects angles with sty = 1).
{\tt a, b, c, col, sty} — same as {\tt byAngleDefine}.
\stopsubsection
\startsubsection[title={byAngleDefineExtended@\#(suffix a, b, c) (expr col, sty) (text optionalColors)}]
Defines a new angle with additional colors. Automatically assigned name has a form of {\tt abc}. Returns nothing.
{@\#} — optional name.
{\tt optionalColors} — of text type, a list of additional colors (currently only affects angles with sty = 1).
{\tt a, b, c, col, sty} — same as {\tt byAngleDefine}.
\stopsubsection
\startsubsection[title={byNamedAngle(text anglesList)}]
Produces already defined angles. Returns a picture of that angles.
{\tt anglesList} — of text type, comma separated angle names.
\stopsubsection
\startsubsection[title={byNamedAngleSidesFull(text anglesList) (text linesList)}]
Produces a picture of side parts of given lines adjacent to given angles. Returns a piture of that side segments.
{\tt anglesList} — of text type, comma separated angle names.
{\tt linesList} — of text type, comma separated line names.
\stopsubsection
\startsubsection[title={byNamedAngleDummySides(text anglesList)}]
Produces a picture of side parts of thin black lines adjacent to given angles. Returns a picture of that side segments.
{\tt anglesList} — of text type, comma separated angle names.
\stopsubsection
\startsubsection[title={byNamedAngleSides(text anglesList) (text linesList)}]
Produces a picture of side parts of given lines adjacent to given angles. Returns a piture of that side segments on top of picture of given angles.
{\tt anglesList} — of text type, comma separated angle names.
{\tt linesList} — of text type, comma separated line names.
\stopsubsection
\startsubsection[title={byNamedAngleResized(text anglesToUse)}]
Produces already defined angles. Returns a picture of that angles in such a way that the smaller angles are scaled up a little, along with their adjacent angles. If no angles are listed, all the defined angles are produced, and that's the most common use for this function. Using it for separate angles is not recommended.
{\tt anglesToUse} — of text type, comma separated angle names.
\stopsubsection
\startsubsection[title={twoRightAngles}]
Produces a generic picture of a flat angle, like this \drawTwoRightAngles , takes no arguments. Returns a picture of a flat angle.
\stopsubsection
\startsubsection[title={rightAngle}]
Produces a generic picture of a right angle, like this \drawRightAngle , takes no arguments. Returns a picture of a right angle.
\stopsubsection
\stopsection
\startsection[title={Magnitudes}]
\startsubsection[title={byMagnitudeSymbolDefine@\#(expr shp, col, sty)}]
Defines a new magnitude symbol. Also defines a magnitude of the same name consisting of one symbol. Automatically assigned name has a form of {\tt shp}. Returns nothing.
{@\#} — optional name.
{\tt shp} — of string type, shape of magnitude symbol: {\tt "circle", "semicircleUp", "semicircleDown", "sectorDown", "sectorUp", "wedgeDown", "wedgeUp", "square", "halfsquare", "rhombus", "halfrhombusUp", "miniTriangleUp", "miniTriangleDown", "miniSquare", "miniCircle"}.
{\tt col} — of color type, magnitude symbol color.
{\tt sty} — of numeric type, magnitude symbol style, 0 for solid, 1 for outline.
\stopsubsection
\startsubsection[title={byNamedMagnitudeSymbol (expr n, hor) (suffix magnitudeSymbolName)}]
Produces already defined magnitude symbol. Returns a picture of magnitude symbol.
{\tt n} — of numeric type, number of magnitude symbols in row.
{\tt hor} — of boolean type, false for horizontally stacked symbols, true for verticaly stacked symbols.
{\tt magnitudeSymbolName} — of suffix type, magnitude symbol name.
\stopsubsection
\startsubsection[title={byMagnitudeDefine@\#(expr al, hor) (text rowsList) (text magnitudeSymbolsList)}]
Defines a magnitude with a given name, composited of given symbols. Returns nothing.
{@\#} — name.
{\tt al} — of numeric type, magnitude alignment, 0 for center, -1 for left, 1 for right.
{\tt hor} — of boolean type, if true, magnitude is aligned vertically.
{\tt rowsList} — of text type, comma delimited list of row lengths.
{\tt magnitudeSymbolsList} — of text type, comma delimited magnitude symbol names.
\stopsubsection
\startsubsection[title={byNamedMagnitude (expr excl) (suffix magnitudeName)}]
Produces a picture ofmagniture. Returns a piture of that magnitude.
{\tt excl} — of numeric type, what rows to exclude, $0$ — exclude nothing, $-n$ — exclude n-th row (or column if {\tt hor}=true), $n$ — exclude everything but n-th row (or column if {\tt hor}=true).
{\tt magnitudeName} — of suffix type, magnitude symbol name.
\stopsubsection
\stopsection
\startsection[title={Labels}]
\startsubsection[title={byTextLabel (suffix labelType) (expr t, p, a, d)}]
Draws a text label. Returns a picture of that label.
{\tt labelType} — of suffix type, label prefix to look for.
{\tt t} — of string type, point name.
{\tt p} — of pair type, label coordinates.
{\tt a} — of numeric type, label angle.
{\tt d} — of numeric type, label distance.
\stopsubsection
\startsubsection[title={byLabelPoint(suffix p)(expr a, d)}]
Draws text label for a point. Returns a picture of that label.
{\tt p} — of suffix type, point name.
{\tt a} — of numeric type, direction in which point is placed (angle in degrees).
{\tt d} — of numeric type, distance at which point is placed (multiplier to {\tt textLabelShift}).
\stopsubsection
\startsubsection[title={byLabelLine(expr d)(text linesList)}]
Draws text labels for lines. Returns a picture of that labels.
{\tt d} — of numeric type, determines side at which labels are placed (either 0 or anything else).
{\tt linesList} — of text type, comma separated line names.
\stopsubsection
\startsubsection[title={byLabelsOnCircle(text pointsList)(suffix cn)}]
Draws text labels on circle (or arc) circumference. Returns a picture of that labels.
{\tt pointsList} — of text type, comma separated point names.
{\tt cn} — of suffix type, circle or arc name.
\stopsubsection
\startsubsection[title={byLabelsOnPolygon(text pointsList)(expr sty, shft)}]
Draws text labels on the vertices of the polygon. Returns a picture of that labels.
{\tt pointsList} — of text type, comma separated point names.
{\tt sty} — of numeric type, variants of point processing. 0 — all points are labeled; 1 — points on straight angles are not labeled; 2 — first and last point are not labeled.
{\tt shft} — of numeric type, labels shift (to compensate for line shift).
\stopsubsection
\startsubsection[title={byLabelLineEnd (suffix a, b)(expr d)}]
Draws text label on on one end of the line.
{\tt a} — of suffix type, point to label.
{\tt b} — of suffix type, second point of the line.
{\tt d} — of numeric type, distance at which label is placed (multiplier to {\tt lineWidth}).
\stopsubsection
\stopsection
\stopchapter
\startchapter[title={\ConTeXt\ part}]
\ConTeXt\ was chosen for its convenient and unified ways of dealing with \MetaPost\ code.
\startsection[title={Core macros}]
These are contained in {\tt preamble.tex}.
\startsubsection[title={defineNewPicture[\#1][\#2]\{\#3\}}]
Defines a new picture, returns nothing.
\#1, optional — {\tt scaleFactor} after main picture.
\#2, optional — {\tt scaleFactor} for main picture.
\#3 — picture itself.
\stopsubsection
\startsubsection[title={drawCurrentPicture}]
Draws the current picture.
\stopsubsection
\startsubsection[title={drawFromCurrentPicture[\#1][\#2]\{\#3\}}]
Draws a picture based on the current picture.
\#1, optional — vertical alignment, middle for middle, anything else for bottom.
\#2, optional — name for drawn picture (instead of drawing it again, one can just call it with \\name).
\#3 — picture itself.
\stopsubsection
\startsubsection[title={drawUnitLine[\#1]\{\#2\}}]
Draws a horizontal line with fixed length.
\#1, optional — line length ({\tt 1cm} by default).
\#2 — comma separated list of line names.
\stopsubsection
\startsubsection[title={drawProportionalLine\{\#1\}}]
Draws a horizontal line with proportional length.
\#1 — comma separated list of line names.
\stopsubsection
\startsubsection[title={drawSizedLine[\#1]\{\#2\}}]
Draws a horizontal line with corrected proportional length.
\#1, optional — length, that will be reproduced $1:1$ ({\tt 2cm} by default).
\#2 — comma separated list of line names.
\stopsubsection
\startsubsection[title={drawPointL[\#1][\#2]\{\#3\}}]
Draws the stubs of the lines adjacent to a given point.
\#1, optional — same as {\tt drawFromCurrentPicture}.
\#2, optional — comma separated list of lines to omit.
\#3 — point name.
\stopsubsection
\startsubsection[title={drawPointM\{\#1\}}]
Draws a point marker.
\#1 — point name.
\stopsubsection
\startsubsection[title={drawTwoRightAngles}]
Draws a flat angle.
\stopsubsection
\startsubsection[title={drawRightAngle}]
Draws a right angle.
\stopsubsection
\startsubsection[title={drawAngle\{\#2\}}]
Draws an angle.
\#1 — comma separated list of angle names.
\stopsubsection
\startsubsection[title={drawPolygon[\#1][\#2]\{\#3\}}]
Draws polygons.
\#1, \#2, both optional — same as {\tt drawFromCurrentPicture}.
\#3 — comma separated list of polygons.
\stopsubsection
\startsubsection[title={drawCircle[\#1][\#2]\{\#3\}}]
Draws circles.
\#1, optional — same as {\tt drawFromCurrentPicture}.
\#2, optional — {\tt scaleFactor} for drawn circles.
\#3 — comma separated list of circles.
\stopsubsection
\startsubsection[title={drawArc[\#1][\#2]\{\#3\}}]
Draws arcs.
\#1, optional — same as {\tt drawFromCurrentPicture}.
\#2, optional — {\tt scaleFactor} for drawn arcs.
\#3 — comma separated list of arcs.
\stopsubsection
\startsubsection[title={drawLine[\#1][\#2]\{\#3\}}]
Draws lines.
\#1, \#2, both optional — same as {\tt drawFromCurrentPicture}.
\#3 — comma separated list of lines.
\stopsubsection
\startsubsection[title={drawMagnitude[\#1][\#2]\{\#3\}}]
Draws magnitude.
\#1, optional — same as {\tt drawFromCurrentPicture}.
\#2, optional — what to exclude from magnitude.
\#3 — magnitude name.
\stopsubsection
\stopsection
\startsection[title={Book-specific macros}]
Some macros are book specific and are of no good use outside of it. They are contained in {\tt preamble_be.tex} and are listed below.
\startsubsection[title={drawCurrentPictureInMargin}]
\stopsubsection
\startsubsection[title={drawCurrentPictureWide}]
\stopsubsection
\startsubsection[title={initialIndentation}]
\stopsubsection
\startsubsection[title={putLettrine}]
\stopsubsection
\startsubsection[title={regularLettrine}]
\stopsubsection
\startsubsection[title={problem}]
\stopsubsection
\startsubsection[title={problemNP}]
\stopsubsection
\startsubsection[title={qed}]
\stopsubsection
\startsubsection[title={drawCurrentPictureInMargin}]
\stopsubsection
\startsubsection[title={figureInMargin}]
\stopsubsection
\stopsection
\stopchapter
\startchapter[title={Lettrines}]
Generated lettrines are not exactly a part of the project and can be safely and easily substituted with anything else, or used anywhere without any dependency on other components.
If generated lettrine files (with names like A0.mps, B1.mps, A1.mps and so on) are missing in lettrines folder, lettrine placing algorithm looks for regular pre-drawn lettrines (with names like A.pdf, B.pdf) if they are also missing, it draws squares with letters inside as placeholders.
In order to generate lettrines, run {\tt mpost lettrines.mp} inside lettrines folder after generating the book.
\stopchapter
\stoptext
%\closeout \lettrineslist