aboutsummaryrefslogtreecommitdiff
path: root/test/writers-lang-and-dir.context
blob: 97a7b01611a909cf6a2c8b2a3413c397deafe5fe (plain)
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
% Enable hyperlinks
\setupinteraction
  [state=start,
  style=,
  color=,
  contrastcolor=]

% make chapter, section bookmarks visible when opening document
\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
\setupinteractionscreen[option=bookmark]

\setuppagenumbering[location={footer,middle}]
\setupbackend[export=yes]
\setupstructure[state=start,method=auto]

% use microtypography
\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
\setupalign[hz,hanging]
\setupitaliccorrection[global, always]

\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted

\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][mm][Latin Modern Math]
\definefontfamily[mainface][ss][Latin Modern Sans]
\definefontfamily[mainface][tt][Latin Modern Typewriter][features=none]
\setupbodyfont[mainface]

\setupwhitespace[medium]

\setuphead[chapter]            [style=\tfd\setupinterlinespace,header=empty]
\setuphead[section]            [style=\tfc\setupinterlinespace]
\setuphead[subsection]         [style=\tfb\setupinterlinespace]
\setuphead[subsubsection]      [style=\bf]
\setuphead[subsubsubsection]   [style=\sc]
\setuphead[subsubsubsubsection][style=\it]

\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]

\definedescription
  [description]
  [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]

\setupitemize[autointro]    % prevent orphan list intro
\setupitemize[indentnext=no]

\setupfloat[figure][default={here,nonumber}]
\setupfloat[table][default={here,nonumber}]

\setupthinrules[width=15em] % width of horizontal rules

\setupxtable[frame=off]
\setupxtable[head][topframe=on,bottomframe=on]
\setupxtable[body][]
\setupxtable[foot][bottomframe=on]


\starttext

\section[title={Empty Divs and Spans},reference={empty-divs-and-spans}]

Some text and

div contents

and more text.

Next paragraph with a span and a word-thatincludesaspanright?

\section[title={Directionality},reference={directionality}]

Some text and

\startalignment[righttoleft]
rtl div contents

\stopalignment

and more text.

\startalignment[lefttoright]
and a ltr div. with a {\righttoleft rtl span}.

\stopalignment

Next paragraph with a {\righttoleft rtl span} and a
word-that-includesa{\lefttoright ltrspan}right?

\section[title={Languages},reference={languages}]

Some text and

\start\language[de]
German div contents

\stop

and more text.

Next paragraph with a {\language[en-gb]British span} and a
word-that-includesa{\language[de-ch]Swiss German span}right?

Some {\language[es]Spanish text}.

\section[title={Combined},reference={combined}]

Some text and

\start\language[fr]
\startalignment[righttoleft]
French rtl div contents

\stopalignment
\stop

and more text.

Next paragraph with a {\language[en-gb]{\lefttoright British ltr span}}
and a word-that-includesa{\language[de-ch]{\lefttoright Swiss German ltr
span}}right?

\stoptext