ma-cb-en-units.tex /size: 2517 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-units
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[reference=units,title=Units]
8
9\index{units}
10\index[siunit]{SI--unit}
11
12\Command{\tex{unit}}
13
14To force yourself to use dimensions and units consistently throughout your
15document you can use the \type{\unit} command. Let's give a few examples:
16
17\startbuffer
18\unit{meter per square meter}
19\unit{cubic meter per sec}
20\unit{square milli meter per inch}
21\unit{centi liter per sec}
22\unit{meter inverse sec}
23\unit{newton per square inch}
24\unit{newton times meter per square sec}
25\stopbuffer
26
27\typebuffer
28
29It looks like a lot of typing but it does guarantee a consistent use of units.
30The command \type{\unit} also prevents linebreaking between number and unit.
31The examples above come out as:
32
33\startnarrower
34\startlines
35\getbuffer
36\stoplines
37\stopnarrower
38
39You can add your own units with:
40
41\shortsetup{registerunit}
42
43and set them up with:
44
45\shortsetup{setupunit}
46
47\startbuffer
48\registerunit[unit][inhab=inhabitants] \setupunittext[inhabitants=inh]
49\registerunit[unit][north=north]       \setupunittext[north= N]
50\registerunit[unit][east=east]         \setupunittext[east= E]
51
52Hasselt is part of the municipality of Zwartewaterland
53(coordinates \unit {52 degrees 35 arcminute north},
54\unit {6 degrees 5 arcminute east}). Its area is about
55\unit {88 square kilometer} (land \unit {83 square kilom}
56and water \unit{5 square km}). As of 1st Augustus 2013 the
57population is 22.201 that is \unit {268 inhab per square kilo
58meter}).
59\stopbuffer
60
61In the example below you can see some new units and the non-consistent
62use of \unit{kilo meter}.
63
64\typebuffer
65
66This results in:
67
68\getbuffer
69
70The \type{\unit} command also allows you to align rows of units in a column.
71
72\startbuffer
73\bTABLE
74\bTR \bTD \bf Street              \eTD \bTD \bf Length         \eTD \eTR
75\bTR \bTD Ridderstraat            \eTD \bTD \unit{_,160 meter} \eTD \eTR
76\bTR \bTD Prinsengracht           \eTD \bTD \unit{_,240 meter} \eTD \eTR
77\bTR \bTD Kalverstraat            \eTD \bTD \unit{_,_60 meter} \eTD \eTR
78\bTR \bTD H.A.W. van de Vechtlaan \eTD \bTD \unit{1,250 meter} \eTD \eTR
79\bTR \bTD Meestersteeg            \eTD \bTD \unit{_,_45 meter} \eTD \eTR
80\eTABLE
81\stopbuffer
82
83When you type:
84
85\typebuffer
86
87It will generate a well aligned second column:
88
89\bgroup
90\setupTABLE[frame=off,offset=0pt]
91\setupTABLE[c][1][width=4.5cm]
92
93\getbuffer
94\egroup
95
96Please refer to the manual \goto {\em Units} [ url(manual:units) ] for more
97information and details.
98
99\stopchapter
100
101\stopcomponent
102