git.iko.soy/typeable/pandoc
on master help sign in
ConTeXt writer: Use xtables instead of Tables (#4223)

- Default to xtables for context output. - Added `ntb` extension (affecting context writer only) to use Natural Tables instead. - Added `Ext_ntb` constructor to `Extension` (API change).

commit6910267abfa7d5a1743589d301e7b9ecf2a54e4f authorHenri Menke <henri@icp.uni-stuttgart.de> dateTue 16 Jan 2018, 14:38 (9 years ago) parentc6a55f8
8 files changed+361−181
MANUAL.txt+8 data/templates/default.context+5 src/Text/Pandoc/Extensions.hs+1 src/Text/Pandoc/Writers/ConTeXt.hs+72−26 test/Tests/Writers/ConTeXt.hs+55 test/tables.context+210−155 test/writer.context+5 test/writers-lang-and-dir.context+5
MANUAL.txt+8
@@ -1960,6 +1960,14 @@ extensions to Emacs Muse markup.
19601960Some aspects of [Pandoc's Markdown citation syntax](#citations) are also accepted
19611961in `org` input.
19621962
1963+#### Extension: `ntb` ####
1964+
1965+In the `context` output format this enables the use of [Natural Tables
1966+(TABLE)](http://wiki.contextgarden.net/TABLE) instead of the default
1967+[Extreme Tables (xtables)](http://wiki.contextgarden.net/xtables).
1968+Natural tables allow more fine-grained global customization but come
1969+at a performance penalty compared to extreme tables.
1970+
19631971
19641972Pandoc's Markdown
19651973=================
data/templates/default.context+5
@@ -92,6 +92,11 @@ $endif$
9292
9393\setupthinrules[width=15em] % width of horizontal rules
9494
95+\setupxtable[frame=off]
96+\setupxtable[head][topframe=on,bottomframe=on]
97+\setupxtable[body][]
98+\setupxtable[foot][bottomframe=on]
99+
95100$for(header-includes)$
96101$header-includes$
97102$endfor$
src/Text/Pandoc/Extensions.hs+1
@@ -133,6 +133,7 @@ data Extension =
133133 | Ext_multiline_tables -- ^ Pandoc-style multiline tables
134134 | Ext_native_divs -- ^ Use Div blocks for contents of <div> tags
135135 | Ext_native_spans -- ^ Use Span inlines for contents of <span>
136+ | Ext_ntb -- ^ ConTeXt Natural Tables
136137 | Ext_old_dashes -- ^ -- = em, - before number = en
137138 | Ext_pandoc_title_block -- ^ Pandoc title block
138139 | Ext_pipe_tables -- ^ Pipe tables (as in PHP markdown extra)
src/Text/Pandoc/Writers/ConTeXt.hs+72−26
@@ -55,6 +55,8 @@ data WriterState =
5555 , stOptions :: WriterOptions -- writer options
5656 }
5757
58+data Tabl = Xtb | Ntb deriving (Show, Eq)
59+
5860orderedListStyles :: [Char]
5961orderedListStyles = cycle "narg"
6062
@@ -252,33 +254,77 @@ blockToConTeXt HorizontalRule = return $ "\\thinrule" <> blankline
252254-- If this is ever executed, provide a default for the reference identifier.
253255blockToConTeXt (Header level attr lst) = sectionHeader attr level lst
254256blockToConTeXt (Table caption aligns widths heads rows) = do
255− let colDescriptor colWidth alignment = (case alignment of
256− AlignLeft -> 'l'
257− AlignRight -> 'r'
258− AlignCenter -> 'c'
259− AlignDefault -> 'l'):
260− if colWidth == 0
261− then "|"
262− else ("p(" ++ printf "%.2f" colWidth ++ "\\textwidth)|")
263− let colDescriptors = "|" ++ concat (
264− zipWith colDescriptor widths aligns)
265− headers <- if all null heads
266− then return empty
267− else liftM ($$ "\\HL") $ tableRowToConTeXt heads
257+ opts <- gets stOptions
258+ let tabl = if isEnabled Ext_ntb opts
259+ then Ntb
260+ else Xtb
268261 captionText <- inlineListToConTeXt caption
269− rows' <- mapM tableRowToConTeXt rows
270− return $ "\\placetable" <> (if null caption
271− then brackets "none"
272− else empty)
273− <> braces captionText $$
274− "\\starttable" <> brackets (text colDescriptors) $$
275− "\\HL" $$ headers $$
276− vcat rows' $$ "\\HL" $$ "\\stoptable" <> blankline
277−
278−tableRowToConTeXt :: PandocMonad m => [[Block]] -> WM m Doc
279−tableRowToConTeXt cols = do
280− cols' <- mapM blockListToConTeXt cols
281− return $ vcat (map ("\\NC " <>) cols') $$ "\\NC\\AR"
262+ headers <- if all null heads
263+ then return empty
264+ else tableRowToConTeXt tabl aligns widths heads
265+ rows' <- mapM (tableRowToConTeXt tabl aligns widths) rows
266+ body <- tableToConTeXt tabl headers rows'
267+ return $ "\\startplacetable" <> brackets (
268+ if null caption
269+ then "location=none"
270+ else "caption=" <> braces captionText
271+ ) $$ body $$ "\\stopplacetable" <> blankline
272+
273+tableToConTeXt :: PandocMonad m => Tabl -> Doc -> [Doc] -> WM m Doc
274+tableToConTeXt Xtb heads rows =
275+ return $ "\\startxtable" $$
276+ (if isEmpty heads
277+ then empty
278+ else "\\startxtablehead[head]" $$ heads $$ "\\stopxtablehead") $$
279+ (if null rows
280+ then empty
281+ else "\\startxtablebody[body]" $$ vcat (init rows) $$ "\\stopxtablebody" $$
282+ "\\startxtablefoot[foot]" $$ last rows $$ "\\stopxtablefoot") $$
283+ "\\stopxtable"
284+tableToConTeXt Ntb heads rows =
285+ return $ "\\startTABLE" $$
286+ (if isEmpty heads
287+ then empty
288+ else "\\startTABLEhead" $$ heads $$ "\\stopTABLEhead") $$
289+ (if null rows
290+ then empty
291+ else "\\startTABLEbody" $$ vcat (init rows) $$ "\\stopTABLEbody" $$
292+ "\\startTABLEfoot" $$ last rows $$ "\\stopTABLEfoot") $$
293+ "\\stopTABLE"
294+
295+tableRowToConTeXt :: PandocMonad m => Tabl -> [Alignment] -> [Double] -> [[Block]] -> WM m Doc
296+tableRowToConTeXt Xtb aligns widths cols = do
297+ cells <- mapM (tableColToConTeXt Xtb) $ zip3 aligns widths cols
298+ return $ "\\startxrow" $$ vcat cells $$ "\\stopxrow"
299+tableRowToConTeXt Ntb aligns widths cols = do
300+ cells <- mapM (tableColToConTeXt Ntb) $ zip3 aligns widths cols
301+ return $ vcat cells $$ "\\NC\\NR"
302+
303+tableColToConTeXt :: PandocMonad m => Tabl -> (Alignment, Double, [Block]) -> WM m Doc
304+tableColToConTeXt tabl (align, width, blocks) = do
305+ cellContents <- blockListToConTeXt blocks
306+ let colwidth = if width == 0
307+ then empty
308+ else "width=" <> braces (text (printf "%.2f\\textwidth" width))
309+ let halign = alignToConTeXt align
310+ let options = (if keys == empty
311+ then empty
312+ else brackets keys) <> space
313+ where keys = hcat $ intersperse "," $ filter (empty /=) [halign, colwidth]
314+ tableCellToConTeXt tabl options cellContents
315+
316+tableCellToConTeXt :: PandocMonad m => Tabl -> Doc -> Doc -> WM m Doc
317+tableCellToConTeXt Xtb options cellContents =
318+ return $ "\\startxcell" <> options <> cellContents <> " \\stopxcell"
319+tableCellToConTeXt Ntb options cellContents =
320+ return $ "\\NC" <> options <> cellContents
321+
322+alignToConTeXt :: Alignment -> Doc
323+alignToConTeXt align = case align of
324+ AlignLeft -> "align=right"
325+ AlignRight -> "align=left"
326+ AlignCenter -> "align=middle"
327+ AlignDefault -> empty
282328
283329listItemToConTeXt :: PandocMonad m => [Block] -> WM m Doc
284330listItemToConTeXt list = blockListToConTeXt list >>=
test/Tests/Writers/ConTeXt.hs+55
@@ -15,6 +15,9 @@ context = unpack . purely (writeConTeXt def) . toPandoc
1515context' :: (ToPandoc a) => a -> String
1616context' = unpack . purely (writeConTeXt def{ writerWrapText = WrapNone }) . toPandoc
1717
18+contextNtb :: (ToPandoc a) => a -> String
19+contextNtb = unpack . purely (writeConTeXt def{ writerExtensions = enableExtension Ext_ntb pandocExtensions }) . toPandoc
20+
1821{-
1922 "my test" =: X =?> Y
2023
@@ -68,5 +71,57 @@ tests = [ testGroup "inline code"
6871 , " \\stopitemize"
6972 , "\\stopitemize" ]
7073 ]
74+ , testGroup "natural tables"
75+ [ test contextNtb "table with header and caption" $
76+ let caption = text "Table 1"
77+ aligns = [(AlignRight, 0.0), (AlignLeft, 0.0), (AlignCenter, 0.0), (AlignDefault, 0.0)]
78+ headers = [plain $ text "Right",
79+ plain $ text "Left",
80+ plain $ text "Center",
81+ plain $ text "Default"]
82+ rows = [[plain $ text "1.1",
83+ plain $ text "1.2",
84+ plain $ text "1.3",
85+ plain $ text "1.4"]
86+ ,[plain $ text "2.1",
87+ plain $ text "2.2",
88+ plain $ text "2.3",
89+ plain $ text "2.4"]
90+ ,[plain $ text "3.1",
91+ plain $ text "3.2",
92+ plain $ text "3.3",
93+ plain $ text "3.4"]]
94+ in table caption aligns headers rows
95+ =?> unlines [ "\\startplacetable[caption={Table 1}]"
96+ , "\\startTABLE"
97+ , "\\startTABLEhead"
98+ , "\\NC[align=left] Right"
99+ , "\\NC[align=right] Left"
100+ , "\\NC[align=middle] Center"
101+ , "\\NC Default"
102+ , "\\NC\\NR"
103+ , "\\stopTABLEhead"
104+ , "\\startTABLEbody"
105+ , "\\NC[align=left] 1.1"
106+ , "\\NC[align=right] 1.2"
107+ , "\\NC[align=middle] 1.3"
108+ , "\\NC 1.4"
109+ , "\\NC\\NR"
110+ , "\\NC[align=left] 2.1"
111+ , "\\NC[align=right] 2.2"
112+ , "\\NC[align=middle] 2.3"
113+ , "\\NC 2.4"
114+ , "\\NC\\NR"
115+ , "\\stopTABLEbody"
116+ , "\\startTABLEfoot"
117+ , "\\NC[align=left] 3.1"
118+ , "\\NC[align=right] 3.2"
119+ , "\\NC[align=middle] 3.3"
120+ , "\\NC 3.4"
121+ , "\\NC\\NR"
122+ , "\\stopTABLEfoot"
123+ , "\\stopTABLE"
124+ , "\\stopplacetable" ]
125+ ]
71126 ]
72127
test/tables.context+210−155
@@ -1,175 +1,230 @@
11Simple table with caption:
22
3−\placetable{Demonstration of simple table syntax.}
4−\starttable[|r|l|c|l|]
5−\HL
6−\NC Right
7−\NC Left
8−\NC Center
9−\NC Default
10−\NC\AR
11−\HL
12−\NC 12
13−\NC 12
14−\NC 12
15−\NC 12
16−\NC\AR
17−\NC 123
18−\NC 123
19−\NC 123
20−\NC 123
21−\NC\AR
22−\NC 1
23−\NC 1
24−\NC 1
25−\NC 1
26−\NC\AR
27−\HL
28−\stoptable
3+\startplacetable[caption={Demonstration of simple table syntax.}]
4+\startxtable
5+\startxtablehead[head]
6+\startxrow
7+\startxcell[align=left] Right \stopxcell
8+\startxcell[align=right] Left \stopxcell
9+\startxcell[align=middle] Center \stopxcell
10+\startxcell Default \stopxcell
11+\stopxrow
12+\stopxtablehead
13+\startxtablebody[body]
14+\startxrow
15+\startxcell[align=left] 12 \stopxcell
16+\startxcell[align=right] 12 \stopxcell
17+\startxcell[align=middle] 12 \stopxcell
18+\startxcell 12 \stopxcell
19+\stopxrow
20+\startxrow
21+\startxcell[align=left] 123 \stopxcell
22+\startxcell[align=right] 123 \stopxcell
23+\startxcell[align=middle] 123 \stopxcell
24+\startxcell 123 \stopxcell
25+\stopxrow
26+\stopxtablebody
27+\startxtablefoot[foot]
28+\startxrow
29+\startxcell[align=left] 1 \stopxcell
30+\startxcell[align=right] 1 \stopxcell
31+\startxcell[align=middle] 1 \stopxcell
32+\startxcell 1 \stopxcell
33+\stopxrow
34+\stopxtablefoot
35+\stopxtable
36+\stopplacetable
2937
3038Simple table without caption:
3139
32−\placetable[none]{}
33−\starttable[|r|l|c|l|]
34−\HL
35−\NC Right
36−\NC Left
37−\NC Center
38−\NC Default
39−\NC\AR
40−\HL
41−\NC 12
42−\NC 12
43−\NC 12
44−\NC 12
45−\NC\AR
46−\NC 123
47−\NC 123
48−\NC 123
49−\NC 123
50−\NC\AR
51−\NC 1
52−\NC 1
53−\NC 1
54−\NC 1
55−\NC\AR
56−\HL
57−\stoptable
40+\startplacetable[location=none]
41+\startxtable
42+\startxtablehead[head]
43+\startxrow
44+\startxcell[align=left] Right \stopxcell
45+\startxcell[align=right] Left \stopxcell
46+\startxcell[align=middle] Center \stopxcell
47+\startxcell Default \stopxcell
48+\stopxrow
49+\stopxtablehead
50+\startxtablebody[body]
51+\startxrow
52+\startxcell[align=left] 12 \stopxcell
53+\startxcell[align=right] 12 \stopxcell
54+\startxcell[align=middle] 12 \stopxcell
55+\startxcell 12 \stopxcell
56+\stopxrow
57+\startxrow
58+\startxcell[align=left] 123 \stopxcell
59+\startxcell[align=right] 123 \stopxcell
60+\startxcell[align=middle] 123 \stopxcell
61+\startxcell 123 \stopxcell
62+\stopxrow
63+\stopxtablebody
64+\startxtablefoot[foot]
65+\startxrow
66+\startxcell[align=left] 1 \stopxcell
67+\startxcell[align=right] 1 \stopxcell
68+\startxcell[align=middle] 1 \stopxcell
69+\startxcell 1 \stopxcell
70+\stopxrow
71+\stopxtablefoot
72+\stopxtable
73+\stopplacetable
5874
5975Simple table indented two spaces:
6076
61−\placetable{Demonstration of simple table syntax.}
62−\starttable[|r|l|c|l|]
63−\HL
64−\NC Right
65−\NC Left
66−\NC Center
67−\NC Default
68−\NC\AR
69−\HL
70−\NC 12
71−\NC 12
72−\NC 12
73−\NC 12
74−\NC\AR
75−\NC 123
76−\NC 123
77−\NC 123
78−\NC 123
79−\NC\AR
80−\NC 1
81−\NC 1
82−\NC 1
83−\NC 1
84−\NC\AR
85−\HL
86−\stoptable
77+\startplacetable[caption={Demonstration of simple table syntax.}]
78+\startxtable
79+\startxtablehead[head]
80+\startxrow
81+\startxcell[align=left] Right \stopxcell
82+\startxcell[align=right] Left \stopxcell
83+\startxcell[align=middle] Center \stopxcell
84+\startxcell Default \stopxcell
85+\stopxrow
86+\stopxtablehead
87+\startxtablebody[body]
88+\startxrow
89+\startxcell[align=left] 12 \stopxcell
90+\startxcell[align=right] 12 \stopxcell
91+\startxcell[align=middle] 12 \stopxcell
92+\startxcell 12 \stopxcell
93+\stopxrow
94+\startxrow
95+\startxcell[align=left] 123 \stopxcell
96+\startxcell[align=right] 123 \stopxcell
97+\startxcell[align=middle] 123 \stopxcell
98+\startxcell 123 \stopxcell
99+\stopxrow
100+\stopxtablebody
101+\startxtablefoot[foot]
102+\startxrow
103+\startxcell[align=left] 1 \stopxcell
104+\startxcell[align=right] 1 \stopxcell
105+\startxcell[align=middle] 1 \stopxcell
106+\startxcell 1 \stopxcell
107+\stopxrow
108+\stopxtablefoot
109+\stopxtable
110+\stopplacetable
87111
88112Multiline table with caption:
89113
90−\placetable{Here's the caption. It may span multiple lines.}
91−\starttable[|cp(0.15\textwidth)|lp(0.14\textwidth)|rp(0.16\textwidth)|lp(0.34\textwidth)|]
92−\HL
93−\NC Centered Header
94−\NC Left Aligned
95−\NC Right Aligned
96−\NC Default aligned
97−\NC\AR
98−\HL
99−\NC First
100−\NC row
101−\NC 12.0
102−\NC Example of a row that spans multiple lines.
103−\NC\AR
104−\NC Second
105−\NC row
106−\NC 5.0
107−\NC Here's another one. Note the blank line between rows.
108−\NC\AR
109−\HL
110−\stoptable
114+\startplacetable[caption={Here's the caption. It may span multiple lines.}]
115+\startxtable
116+\startxtablehead[head]
117+\startxrow
118+\startxcell[align=middle,width={0.15\textwidth}] Centered Header \stopxcell
119+\startxcell[align=right,width={0.14\textwidth}] Left Aligned \stopxcell
120+\startxcell[align=left,width={0.16\textwidth}] Right Aligned \stopxcell
121+\startxcell[align=right,width={0.34\textwidth}] Default aligned \stopxcell
122+\stopxrow
123+\stopxtablehead
124+\startxtablebody[body]
125+\startxrow
126+\startxcell[align=middle,width={0.15\textwidth}] First \stopxcell
127+\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
128+\startxcell[align=left,width={0.16\textwidth}] 12.0 \stopxcell
129+\startxcell[align=right,width={0.34\textwidth}] Example of a row that spans
130+multiple lines. \stopxcell
131+\stopxrow
132+\stopxtablebody
133+\startxtablefoot[foot]
134+\startxrow
135+\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
136+\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
137+\startxcell[align=left,width={0.16\textwidth}] 5.0 \stopxcell
138+\startxcell[align=right,width={0.34\textwidth}] Here's another one. Note the
139+blank line between rows. \stopxcell
140+\stopxrow
141+\stopxtablefoot
142+\stopxtable
143+\stopplacetable
111144
112145Multiline table without caption:
113146
114−\placetable[none]{}
115−\starttable[|cp(0.15\textwidth)|lp(0.14\textwidth)|rp(0.16\textwidth)|lp(0.34\textwidth)|]
116−\HL
117−\NC Centered Header
118−\NC Left Aligned
119−\NC Right Aligned
120−\NC Default aligned
121−\NC\AR
122−\HL
123−\NC First
124−\NC row
125−\NC 12.0
126−\NC Example of a row that spans multiple lines.
127−\NC\AR
128−\NC Second
129−\NC row
130−\NC 5.0
131−\NC Here's another one. Note the blank line between rows.
132−\NC\AR
133−\HL
134−\stoptable
147+\startplacetable[location=none]
148+\startxtable
149+\startxtablehead[head]
150+\startxrow
151+\startxcell[align=middle,width={0.15\textwidth}] Centered Header \stopxcell
152+\startxcell[align=right,width={0.14\textwidth}] Left Aligned \stopxcell
153+\startxcell[align=left,width={0.16\textwidth}] Right Aligned \stopxcell
154+\startxcell[align=right,width={0.34\textwidth}] Default aligned \stopxcell
155+\stopxrow
156+\stopxtablehead
157+\startxtablebody[body]
158+\startxrow
159+\startxcell[align=middle,width={0.15\textwidth}] First \stopxcell
160+\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
161+\startxcell[align=left,width={0.16\textwidth}] 12.0 \stopxcell
162+\startxcell[align=right,width={0.34\textwidth}] Example of a row that spans
163+multiple lines. \stopxcell
164+\stopxrow
165+\stopxtablebody
166+\startxtablefoot[foot]
167+\startxrow
168+\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
169+\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
170+\startxcell[align=left,width={0.16\textwidth}] 5.0 \stopxcell
171+\startxcell[align=right,width={0.34\textwidth}] Here's another one. Note the
172+blank line between rows. \stopxcell
173+\stopxrow
174+\stopxtablefoot
175+\stopxtable
176+\stopplacetable
135177
136178Table without column headers:
137179
138−\placetable[none]{}
139−\starttable[|r|l|c|r|]
140−\HL
141−\NC 12
142−\NC 12
143−\NC 12
144−\NC 12
145−\NC\AR
146−\NC 123
147−\NC 123
148−\NC 123
149−\NC 123
150−\NC\AR
151−\NC 1
152−\NC 1
153−\NC 1
154−\NC 1
155−\NC\AR
156−\HL
157−\stoptable
180+\startplacetable[location=none]
181+\startxtable
182+\startxtablebody[body]
183+\startxrow
184+\startxcell[align=left] 12 \stopxcell
185+\startxcell[align=right] 12 \stopxcell
186+\startxcell[align=middle] 12 \stopxcell
187+\startxcell[align=left] 12 \stopxcell
188+\stopxrow
189+\startxrow
190+\startxcell[align=left] 123 \stopxcell
191+\startxcell[align=right] 123 \stopxcell
192+\startxcell[align=middle] 123 \stopxcell
193+\startxcell[align=left] 123 \stopxcell
194+\stopxrow
195+\stopxtablebody
196+\startxtablefoot[foot]
197+\startxrow
198+\startxcell[align=left] 1 \stopxcell
199+\startxcell[align=right] 1 \stopxcell
200+\startxcell[align=middle] 1 \stopxcell
201+\startxcell[align=left] 1 \stopxcell
202+\stopxrow
203+\stopxtablefoot
204+\stopxtable
205+\stopplacetable
158206
159207Multiline table without column headers:
160208
161−\placetable[none]{}
162−\starttable[|cp(0.15\textwidth)|lp(0.14\textwidth)|rp(0.16\textwidth)|lp(0.34\textwidth)|]
163−\HL
164−\NC First
165−\NC row
166−\NC 12.0
167−\NC Example of a row that spans multiple lines.
168−\NC\AR
169−\NC Second
170−\NC row
171−\NC 5.0
172−\NC Here's another one. Note the blank line between rows.
173−\NC\AR
174−\HL
175−\stoptable
209+\startplacetable[location=none]
210+\startxtable
211+\startxtablebody[body]
212+\startxrow
213+\startxcell[align=middle,width={0.15\textwidth}] First \stopxcell
214+\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
215+\startxcell[align=left,width={0.16\textwidth}] 12.0 \stopxcell
216+\startxcell[width={0.34\textwidth}] Example of a row that spans multiple
217+lines. \stopxcell
218+\stopxrow
219+\stopxtablebody
220+\startxtablefoot[foot]
221+\startxrow
222+\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
223+\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
224+\startxcell[align=left,width={0.16\textwidth}] 5.0 \stopxcell
225+\startxcell[width={0.34\textwidth}] Here's another one. Note the blank line
226+between rows. \stopxcell
227+\stopxrow
228+\stopxtablefoot
229+\stopxtable
230+\stopplacetable
test/writer.context+5
@@ -51,6 +51,11 @@
5151
5252\setupthinrules[width=15em] % width of horizontal rules
5353
54+\setupxtable[frame=off]
55+\setupxtable[head][topframe=on,bottomframe=on]
56+\setupxtable[body][]
57+\setupxtable[foot][bottomframe=on]
58+
5459
5560\starttext
5661\startalignment[middle]
test/writers-lang-and-dir.context+5
@@ -49,6 +49,11 @@
4949
5050\setupthinrules[width=15em] % width of horizontal rules
5151
52+\setupxtable[frame=off]
53+\setupxtable[head][topframe=on,bottomframe=on]
54+\setupxtable[body][]
55+\setupxtable[foot][bottomframe=on]
56+
5257
5358\starttext
5459