s-braille-basic.mkxl /size: 4109 b    last modification: 2024-01-16 10:22
1%D \module
2%D   [      file=s-braille-basic,
3%D        version=2021.11.17,
4%D          title=\CONTEXT\ Style File,
5%D       subtitle=Playground for spacing,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D This style is triggered by the 2021 blog by Murray Sargent (from Microsoft)
15%D about nemeth sequences:
16%D
17%D \starttyping
18%D https://devblogs.microsoft.com/math-in-office/unicode-math-braille-sequences/
19%D \stoptyping
20%D
21%D I ran into it when Mikael Sundqvist and I were working on an upgrade of the lfg
22%D (goodie) files for math. Being sort of monospaces a braille font is a good
23%D candidate for exploring al these math spacing parameters.
24%D
25%D More settings might show up and existing ones might change so it's mostly an
26%D example style. Fell free to contribute. We use color so that we can see what
27%D we're dealing with. Braille looks kind of interesting anyway although it was
28%D never meant to be seen but felt.
29%D
30%D Musical timestamp: Nothing but the truth (PT with GH drum cam 5.1 bluray) ...
31%D ... I'm always amazed of the power of music and wonder how that evolved with
32%D and in humans.
33
34\startmodule[braille-basic]
35
36\unprotect
37
38\definemeasure [braille:margin]  [\paperheight/15]
39
40\definelayout
41  [braille]
42  [\c!topspace=\measure{braille:margin},
43   \c!bottomspace=\measure{braille:margin},
44   \c!backspace=\measure{braille:margin},
45   \c!header=\measure{braille:margin},
46   \c!footer=\zeropoint,
47   \c!width=\v!middle,
48   \c!height=\v!middle]
49
50\setuplayout
51  [braille]
52
53\enableexperiments[fonts.compact]
54
55\setupbodyfont
56  [braille,11pt]
57
58\setupwhitespace
59  [\v!big]
60
61\setuphead
62  [\v!chapter]
63  [\c!style=\bfd,
64   \c!color=darkblue,
65   \c!headerstate=\v!high,
66   \c!interaction=\v!all]
67
68\setuphead
69  [\v!section]
70  [\c!style=\bfc,
71   \c!color=darkblue]
72
73\setuphead
74  [\v!subsection]
75  [\c!style=\bfb]
76
77\setuphead
78  [\v!subsubsection]
79  [\c!style=\bfa,
80   \c!after=]
81
82\setuplist
83  [\c!interaction=\v!all]
84
85\setupdocument
86  [\c!before=\directsetup{document:titlepage}]
87
88\setupalign
89  [\v!verytolerant,\v!flushleft]
90
91\setupitemgroup[\v!itemize][1][\c!width=4em,\c!style=\s!bold,\c!color=darkred]
92\setupitemgroup[\v!itemize][2][\c!width=5em,\c!style=\s!bold,\c!color=darkred]
93\setupitemgroup[\v!itemize][3][\c!width=6em,\c!style=\s!bold,\c!color=darkred]
94
95\setuptyping
96  [\c!color=darkyellow]
97
98\setuptype
99  [\c!color=darkyellow]
100
101\setupformulas
102  [\c!color=darkgreen]
103
104\protect
105
106\stopmodule
107
108\continueifinputfile{s-braille-basic.mkxl}
109
110\starttext
111
112\showframe \showglyphs \showboxes \dontcomplain
113
114\startchapter[title=The first]
115
116\startsection[title=Tufte] {\tf \samplefile{tufte}\par} \stopsection
117\startsection[title=Ward]  {\bf \samplefile{ward} \par} \stopsection
118\startsection[title=Davis] {\bi \samplefile{davis}\par} \stopsection
119
120\startsection[title=Four]
121
122    Here is some simple inline math: \formula {x_2 = 10 \neq \alpha} and here is
123    some (quick and dirty) display:
124
125    \startformula
126        y = \sqrt[2]{\frac{1+x^2}{2x+x^2+4}}
127    \stopformula
128
129    but there are rules for that. So we need to look into those so that:
130
131    \startformula
132        y = \frac{1+x^2}{2x+x^2+4}
133    \stopformula
134
135    and
136
137    \startformula
138        y = \overline{2x+x^2+4} + \underline{2x+x^2+4}
139      % y = \overbar{2x+x^2+4}
140    \stopformula
141
142    come out right.
143
144\stopsection
145
146\stopchapter
147
148\startchapter[title=The second]
149
150The monospaced font has no braille but actually all is kind of monospace apart
151from spacing:
152
153\starttyping
154Let's show some {\bf fancy tex} code,
155assuming that mono has gotten the
156braille glyphs.
157\stoptyping
158
159And some itemize:
160
161\startitemize[n]
162    \startitem first one \stopitem
163    \startitem second one \stopitem
164\stopitemize
165
166\startitemize
167    \startitem first one \stopitem
168    \startitem second one \stopitem
169\stopitemize
170
171\startitemize[a]
172    \startitem first one \stopitem
173    \startitem second one \stopitem
174\stopitemize
175
176\stopchapter
177
178\stoptext
179