git.iko.soy/typeable/pandoc
on master help sign in
More improvements to ConTeXt writer:

+ writer options are now in state, so they don't have to be passed as a parameter + state also keeps track of ordered list level, so the right default numbering scheme can be used + extra blank line after \stopitemize + removed definitions of ltxenum and ltxitem from the preamble + both kinds of lists are now generated using \start-stopitemize, with appropriate options + in the case of bulleted lists, no options need be specified, because defaults are given in the preamble + test suite updated accordingly git-svn-id: https://pandoc.googlecode.com/svn/trunk@1084 788f1e2b-df1e-0410-8736-df70ead52e1b

commitf4a1fa4b8db8299080bc65e6bebdc149480221c0 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 18 Nov 2007, 01:24 (19 years ago) parent5fa7869
3 files changed+260−196
src/Text/Pandoc/Writers/ConTeXt.hs+100−79 src/headers/ConTeXtHeader+5−13 tests/writer.context+155−104
src/Text/Pandoc/Writers/ConTeXt.hs+100−79
@@ -35,16 +35,27 @@ import Data.List ( (\\), intersperse )
3535import Control.Monad.State
3636import Text.PrettyPrint.HughesPJ hiding ( Str )
3737
38−type WriterState = Int -- number of next URL reference
38+data WriterState =
39+ WriterState { stNextRef :: Int -- number of next URL reference
40+ , stOrderedListLevel :: Int -- level of ordered list
41+ , stOptions :: WriterOptions -- writer options
42+ }
43+
44+orderedListStyles = cycle ["[n]","[a]", "[r]", "[g]"]
3945
4046-- | Convert Pandoc to ConTeXt.
4147writeConTeXt :: WriterOptions -> Pandoc -> String
42−writeConTeXt options document = render $
43− evalState (pandocToConTeXt options document) 1
48+writeConTeXt options document =
49+ let defaultWriterState = WriterState { stNextRef = 1
50+ , stOrderedListLevel = 0
51+ , stOptions = options
52+ }
53+ in render $
54+ evalState (pandocToConTeXt options document) defaultWriterState
4455
4556pandocToConTeXt :: WriterOptions -> Pandoc -> State WriterState Doc
4657pandocToConTeXt options (Pandoc meta blocks) = do
47− main <- blockListToConTeXt options blocks
58+ main <- blockListToConTeXt blocks
4859 let before = if null (writerIncludeBefore options)
4960 then empty
5061 else text $ writerIncludeBefore options
@@ -70,7 +81,7 @@ contextHeader :: WriterOptions -- ^ Options, including ConTeXt header
7081contextHeader options (Meta title authors date) = do
7182 titletext <- if null title
7283 then return empty
73− else inlineListToConTeXt options title
84+ else inlineListToConTeXt title
7485 let authorstext = if null authors
7586 then ""
7687 else if length authors == 1
@@ -111,26 +122,35 @@ stringToConTeXt :: String -> String
111122stringToConTeXt = concatMap escapeCharForConTeXt
112123
113124-- | Convert Pandoc block element to ConTeXt.
114−blockToConTeXt :: WriterOptions
115− -> Block
125+blockToConTeXt :: Block
116126 -> State WriterState Doc
117−blockToConTeXt opts Null = return empty
118−blockToConTeXt opts (Plain lst) =
119− wrapTeXIfNeeded opts False (inlineListToConTeXt opts) lst >>= return
120−blockToConTeXt opts (Para lst) =
121− wrapTeXIfNeeded opts False (inlineListToConTeXt opts) lst >>= return . (<> char '\n')
122−blockToConTeXt opts (BlockQuote lst) = do
123− contents <- blockListToConTeXt opts lst
127+blockToConTeXt Null = return empty
128+blockToConTeXt (Plain lst) = do
129+ st <- get
130+ let options = stOptions st
131+ contents <- wrapTeXIfNeeded options False inlineListToConTeXt lst
132+ return contents
133+blockToConTeXt (Para lst) = do
134+ st <- get
135+ let options = stOptions st
136+ contents <- wrapTeXIfNeeded options False inlineListToConTeXt lst
137+ return $ contents <> char '\n'
138+blockToConTeXt (BlockQuote lst) = do
139+ contents <- blockListToConTeXt lst
124140 return $ text "\\startblockquote\n" $$ contents $$ text "\\stopblockquote"
125−blockToConTeXt opts (CodeBlock str) =
141+blockToConTeXt (CodeBlock str) =
126142 return $ text $ "\\starttyping\n" ++ str ++ "\n\\stoptyping\n" -- \n needed
127143 -- because \stoptyping can't have anything after it
128−blockToConTeXt opts (RawHtml str) = return empty
129−blockToConTeXt opts (BulletList lst) = do
130− contents <- mapM (listItemToConTeXt opts) lst
131− return $ text "\\startltxitem" $$ vcat contents $$ text "\\stopltxitem"
132−blockToConTeXt opts (OrderedList (start, style, delim) lst) = do
133− contents <- mapM (listItemToConTeXt opts) lst
144+blockToConTeXt (RawHtml str) = return empty
145+blockToConTeXt (BulletList lst) = do
146+ contents <- mapM listItemToConTeXt lst
147+ return $ text "\\startitemize" $$ vcat contents $$ text "\\stopitemize\n"
148+blockToConTeXt (OrderedList (start, style, delim) lst) = do
149+ st <- get
150+ let level = stOrderedListLevel st
151+ put $ st {stOrderedListLevel = level + 1}
152+ contents <- mapM listItemToConTeXt lst
153+ put $ st {stOrderedListLevel = level}
134154 let start' = if start == 1 then "" else "start=" ++ show start
135155 let delim' = case delim of
136156 DefaultDelim -> ""
@@ -148,7 +168,7 @@ blockToConTeXt opts (OrderedList (start, style, delim) lst) = do
148168 then ""
149169 else "[" ++ joinWithSep "," specs2Items ++ "]"
150170 let style' = case style of
151− DefaultStyle -> if null specs2 then "" else "[]"
171+ DefaultStyle -> orderedListStyles !! level
152172 Decimal -> "[n]"
153173 LowerRoman -> "[r]"
154174 UpperRoman -> "[R]"
@@ -157,17 +177,19 @@ blockToConTeXt opts (OrderedList (start, style, delim) lst) = do
157177 let specs = style' ++ specs2
158178 return $ text ("\\startitemize" ++ specs) $$ vcat contents $$
159179 text "\\stopitemize\n"
160−blockToConTeXt opts (DefinitionList lst) =
161− mapM (defListItemToConTeXt opts) lst >>= return . (<> char '\n') . vcat
162−blockToConTeXt opts HorizontalRule = return $ text "\\thinrule\n"
163−blockToConTeXt opts (Header level lst) = do
164− contents <- inlineListToConTeXt opts lst
180+blockToConTeXt (DefinitionList lst) =
181+ mapM defListItemToConTeXt lst >>= return . (<> char '\n') . vcat
182+blockToConTeXt HorizontalRule = return $ text "\\thinrule\n"
183+blockToConTeXt (Header level lst) = do
184+ contents <- inlineListToConTeXt lst
185+ st <- get
186+ let opts = stOptions st
165187 let base = if writerNumberSections opts then "section" else "subject"
166188 return $ if level >= 1 && level <= 5
167189 then char '\\' <> text (concat (replicate (level - 1) "sub")) <>
168190 text base <> char '{' <> contents <> char '}' <> char '\n'
169191 else contents <> char '\n'
170−blockToConTeXt opts (Table caption aligns widths heads rows) = do
192+blockToConTeXt (Table caption aligns widths heads rows) = do
171193 let colWidths = map printDecimal widths
172194 let colDescriptor colWidth alignment = (case alignment of
173195 AlignLeft -> 'l'
@@ -177,10 +199,10 @@ blockToConTeXt opts (Table caption aligns widths heads rows) = do
177199 "p(" ++ colWidth ++ "\\textwidth)|"
178200 let colDescriptors = "|" ++ (concat $
179201 zipWith colDescriptor colWidths aligns)
180− headers <- tableRowToConTeXt opts heads
181− captionText <- inlineListToConTeXt opts caption
202+ headers <- tableRowToConTeXt heads
203+ captionText <- inlineListToConTeXt caption
182204 let captionText' = if null caption then text "none" else captionText
183− rows' <- mapM (tableRowToConTeXt opts) rows
205+ rows' <- mapM tableRowToConTeXt rows
184206 return $ text "\\placetable[here]{" <> captionText' <> char '}' $$
185207 text "\\starttable[" <> text colDescriptors <> char ']' $$
186208 text "\\HL" $$ headers $$ text "\\HL" $$
@@ -189,31 +211,30 @@ blockToConTeXt opts (Table caption aligns widths heads rows) = do
189211printDecimal :: Float -> String
190212printDecimal = printf "%.2f"
191213
192−tableRowToConTeXt opts cols = do
193− cols' <- mapM (blockListToConTeXt opts) cols
214+tableRowToConTeXt cols = do
215+ cols' <- mapM blockListToConTeXt cols
194216 return $ (vcat (map (text "\\NC " <>) cols')) $$
195217 text "\\NC\\AR"
196218
197−listItemToConTeXt opts list = blockListToConTeXt opts list >>=
219+listItemToConTeXt list = blockListToConTeXt list >>=
198220 return . (text "\\item " $$) . (nest 2)
199221
200−orderedListItemToConTeXt opts marker list = blockListToConTeXt opts list >>=
222+orderedListItemToConTeXt marker list = blockListToConTeXt list >>=
201223 return . (text ("\\sym{" ++ marker ++ "} ") $$) . (nest 2)
202224
203−defListItemToConTeXt opts (term, def) = do
204− term' <- inlineListToConTeXt opts term
205− def' <- blockListToConTeXt opts def
225+defListItemToConTeXt (term, def) = do
226+ term' <- inlineListToConTeXt term
227+ def' <- blockListToConTeXt def
206228 return $ text "\\startdescr{" <> term' <> char '}' $$ def' $$ text "\\stopdescr"
207229
208230-- | Convert list of block elements to ConTeXt.
209−blockListToConTeXt :: WriterOptions -> [Block] -> State WriterState Doc
210−blockListToConTeXt opts lst = mapM (blockToConTeXt opts) lst >>= return . vcat
231+blockListToConTeXt :: [Block] -> State WriterState Doc
232+blockListToConTeXt lst = mapM blockToConTeXt lst >>= return . vcat
211233
212234-- | Convert list of inline elements to ConTeXt.
213−inlineListToConTeXt :: WriterOptions
214− -> [Inline] -- ^ Inlines to convert
235+inlineListToConTeXt :: [Inline] -- ^ Inlines to convert
215236 -> State WriterState Doc
216−inlineListToConTeXt opts lst = mapM (inlineToConTeXt opts) lst >>= return . hcat
237+inlineListToConTeXt lst = mapM inlineToConTeXt lst >>= return . hcat
217238
218239isQuoted :: Inline -> Bool
219240isQuoted (Quoted _ _) = True
@@ -221,55 +242,55 @@ isQuoted Apostrophe = True
221242isQuoted _ = False
222243
223244-- | Convert inline element to ConTeXt
224−inlineToConTeXt :: WriterOptions
225− -> Inline -- ^ Inline to convert
245+inlineToConTeXt :: Inline -- ^ Inline to convert
226246 -> State WriterState Doc
227−inlineToConTeXt opts (Emph lst) = do
228− contents <- inlineListToConTeXt opts lst
247+inlineToConTeXt (Emph lst) = do
248+ contents <- inlineListToConTeXt lst
229249 return $ text "{\\em " <> contents <> char '}'
230−inlineToConTeXt opts (Strong lst) = do
231− contents <- inlineListToConTeXt opts lst
250+inlineToConTeXt (Strong lst) = do
251+ contents <- inlineListToConTeXt lst
232252 return $ text "{\\bf " <> contents <> char '}'
233−inlineToConTeXt opts (Strikeout lst) = do
234− contents <- inlineListToConTeXt opts lst
253+inlineToConTeXt (Strikeout lst) = do
254+ contents <- inlineListToConTeXt lst
235255 return $ text "\\overstrikes{" <> contents <> char '}'
236−inlineToConTeXt opts (Superscript lst) = do
237− contents <- inlineListToConTeXt opts lst
256+inlineToConTeXt (Superscript lst) = do
257+ contents <- inlineListToConTeXt lst
238258 return $ text "\\high{" <> contents <> char '}'
239−inlineToConTeXt opts (Subscript lst) = do
240− contents <- inlineListToConTeXt opts lst
259+inlineToConTeXt (Subscript lst) = do
260+ contents <- inlineListToConTeXt lst
241261 return $ text "\\low{" <> contents <> char '}'
242−inlineToConTeXt opts (Code str) = return $ text $ "\\type{" ++ str ++ "}"
243−inlineToConTeXt opts (Quoted SingleQuote lst) = do
244− contents <- inlineListToConTeXt opts lst
262+inlineToConTeXt (Code str) = return $ text $ "\\type{" ++ str ++ "}"
263+inlineToConTeXt (Quoted SingleQuote lst) = do
264+ contents <- inlineListToConTeXt lst
245265 return $ text "\\quote{" <> contents <> char '}'
246−inlineToConTeXt opts (Quoted DoubleQuote lst) = do
247− contents <- inlineListToConTeXt opts lst
266+inlineToConTeXt (Quoted DoubleQuote lst) = do
267+ contents <- inlineListToConTeXt lst
248268 return $ text "\\quotation{" <> contents <> char '}'
249−inlineToConTeXt opts Apostrophe = return $ char '\''
250−inlineToConTeXt opts EmDash = return $ text "---"
251−inlineToConTeXt opts EnDash = return $ text "--"
252−inlineToConTeXt opts Ellipses = return $ text "\\ldots{}"
253−inlineToConTeXt opts (Str str) = return $ text $ stringToConTeXt str
254−inlineToConTeXt opts (TeX str) = return $ text str
255−inlineToConTeXt opts (HtmlInline str) = return empty
256−inlineToConTeXt opts (LineBreak) = return $ text "\\crlf\n"
257−inlineToConTeXt opts Space = return $ char ' '
258−inlineToConTeXt opts (Link [Code str] (src, tit)) = -- since ConTeXt has its own
259− inlineToConTeXt opts (Link [Str str] (src, tit)) -- way of printing links...
260−inlineToConTeXt opts (Link txt (src, _)) = do
261− next <- get
262− put (next + 1)
269+inlineToConTeXt Apostrophe = return $ char '\''
270+inlineToConTeXt EmDash = return $ text "---"
271+inlineToConTeXt EnDash = return $ text "--"
272+inlineToConTeXt Ellipses = return $ text "\\ldots{}"
273+inlineToConTeXt (Str str) = return $ text $ stringToConTeXt str
274+inlineToConTeXt (TeX str) = return $ text str
275+inlineToConTeXt (HtmlInline str) = return empty
276+inlineToConTeXt (LineBreak) = return $ text "\\crlf\n"
277+inlineToConTeXt Space = return $ char ' '
278+inlineToConTeXt (Link [Code str] (src, tit)) = -- since ConTeXt has its own
279+ inlineToConTeXt (Link [Str str] (src, tit)) -- way of printing links...
280+inlineToConTeXt (Link txt (src, _)) = do
281+ st <- get
282+ let next = stNextRef st
283+ put $ st {stNextRef = next + 1}
263284 let ref = show next
264− label <- inlineListToConTeXt opts txt
285+ label <- inlineListToConTeXt txt
265286 return $ text "\\useurl[" <> text ref <> text "][" <> text src <>
266287 text "][][" <> label <> text "]\\from[" <> text ref <> char ']'
267−inlineToConTeXt opts (Image alternate (src, tit)) = do
268− alt <- inlineListToConTeXt opts alternate
288+inlineToConTeXt (Image alternate (src, tit)) = do
289+ alt <- inlineListToConTeXt alternate
269290 return $ text "\\placefigure\n[]\n[fig:" <> alt <> text "]\n{" <>
270291 text tit <> text "}\n{\\externalfigure[" <> text src <> text "]}"
271−inlineToConTeXt opts (Note contents) = do
272− contents' <- blockListToConTeXt opts contents
292+inlineToConTeXt (Note contents) = do
293+ contents' <- blockListToConTeXt contents
273294 return $ text " \\footnote{" <>
274295 text (stripTrailingNewlines $ render contents') <>
275296 char '}'
src/headers/ConTeXtHeader+5−13
@@ -37,19 +37,11 @@
3737 headstyle=bold,style=normal,align=left,location=hanging,
3838 width=broad,margin=1cm]
3939
40−% define ltxitem (for bulleted lists)
41−\defineitemgroup[ltxitem][levels=4]
42−\setupitemgroup[ltxitem][1][1]
43−\setupitemgroup[ltxitem][2][2]
44−\setupitemgroup[ltxitem][3][3]
45−\setupitemgroup[ltxitem][4][4,packed]
46−
47−% define ltxenum (for enumerated lists)
48−\defineitemgroup[ltxenum][levels=4]
49−\setupitemgroup[ltxenum][1][n]
50−\setupitemgroup[ltxenum][2][a]
51−\setupitemgroup[ltxenum][3][r]
52−\setupitemgroup[ltxenum][4][A,packed]
40+% define defaults for bulleted lists
41+\setupitemize[1][symbol=1][indentnext=no]
42+\setupitemize[2][symbol=2][indentnext=no]
43+\setupitemize[3][symbol=3][indentnext=no]
44+\setupitemize[4][symbol=4][indentnext=no]
5345
5446\setupthinrules[width=15em] % width of horizontal rules
5547
tests/writer.context+155−104
@@ -37,28 +37,34 @@
3737 headstyle=bold,style=normal,align=left,location=hanging,
3838 width=broad,margin=1cm]
3939
40−% define ltxitem (for bulleted lists)
41−\defineitemgroup[ltxitem][levels=4]
42−\setupitemgroup[ltxitem][1][1]
43−\setupitemgroup[ltxitem][2][2]
44−\setupitemgroup[ltxitem][3][3]
45−\setupitemgroup[ltxitem][4][4,packed]
46−
47−% define ltxenum (for enumerated lists)
48−\defineitemgroup[ltxenum][levels=4]
49−\setupitemgroup[ltxenum][1][n]
50−\setupitemgroup[ltxenum][2][a]
51−\setupitemgroup[ltxenum][3][r]
52−\setupitemgroup[ltxenum][4][A,packed]
40+% define defaults for bulleted lists
41+\setupitemize[1][symbol=1][indentnext=no]
42+\setupitemize[2][symbol=2][indentnext=no]
43+\setupitemize[3][symbol=3][indentnext=no]
44+\setupitemize[4][symbol=4][indentnext=no]
5345
5446\setupthinrules[width=15em] % width of horizontal rules
5547
5648% for block quotations
57−\definestartstop [blockquote]
58− [before={\startnarrower\switchtobodyfont[11pt]
59− \whitespace\setupindenting[no]},
60− after={\stopnarrower\whitespace}]
49+\unprotect
50+
51+\startvariables all
52+blockquote: blockquote
53+\stopvariables
54+
55+\definedelimitedtext
56+[\v!blockquote][\v!quotation]
57+
58+\setupdelimitedtext
59+[\v!blockquote]
60+[\c!left=,
61+\c!right=,
62+before={\blank[medium]},
63+after={\blank[medium]},
64+]
6165
66+\protect
67+
6268
6369\doctitle{Pandoc Test Suite}
6470\author{John MacFarlane \& Anonymous}
@@ -115,10 +121,12 @@ here.
115121E-mail style:
116122
117123\startblockquote
124+
118125This is a block quote. It is pretty short.
119126
120127\stopblockquote
121128\startblockquote
129+
122130Code in a block quote:
123131
124132\starttyping
@@ -129,19 +137,22 @@ sub status {
129137
130138A list:
131139
132−\startitemize
133−\sym{1.}
140+\startitemize[n][stopper=.]
141+\item
134142 item one
135−\sym{2.}
143+\item
136144 item two
137145\stopitemize
146+
138147Nested block quotes:
139148
140149\startblockquote
150+
141151nested
142152
143153\stopblockquote
144154\startblockquote
155+
145156nested
146157
147158\stopblockquote
@@ -151,6 +162,7 @@ This should not be a block quote: 2 \lettermore{} 1.
151162Box-style:
152163
153164\startblockquote
165+
154166Example:
155167
156168\starttyping
@@ -161,19 +173,23 @@ sub status {
161173
162174\stopblockquote
163175\startblockquote
164−\startitemize
165−\sym{1.}
176+
177+\startitemize[n][stopper=.]
178+\item
166179 do laundry
167−\sym{2.}
180+\item
168181 take out the trash
169182\stopitemize
183+
170184\stopblockquote
171185Here's a nested one:
172186
173187\startblockquote
188+
174189Joe said:
175190
176191\startblockquote
192+
177193Don't quote me.
178194
179195\stopblockquote
@@ -212,17 +228,18 @@ These should not be escaped: \$ \\ \> \[ \{
212228
213229Asterisks tight:
214230
215−\startltxitem
231+\startitemize
216232\item
217233 asterisk 1
218234\item
219235 asterisk 2
220236\item
221237 asterisk 3
222−\stopltxitem
238+\stopitemize
239+
223240Asterisks loose:
224241
225−\startltxitem
242+\startitemize
226243\item
227244 asterisk 1
228245
@@ -232,20 +249,22 @@ Asterisks loose:
232249\item
233250 asterisk 3
234251
235−\stopltxitem
252+\stopitemize
253+
236254Pluses tight:
237255
238−\startltxitem
256+\startitemize
239257\item
240258 Plus 1
241259\item
242260 Plus 2
243261\item
244262 Plus 3
245−\stopltxitem
263+\stopitemize
264+
246265Pluses loose:
247266
248−\startltxitem
267+\startitemize
249268\item
250269 Plus 1
251270
@@ -255,20 +274,22 @@ Pluses loose:
255274\item
256275 Plus 3
257276
258−\stopltxitem
277+\stopitemize
278+
259279Minuses tight:
260280
261−\startltxitem
281+\startitemize
262282\item
263283 Minus 1
264284\item
265285 Minus 2
266286\item
267287 Minus 3
268−\stopltxitem
288+\stopitemize
289+
269290Minuses loose:
270291
271−\startltxitem
292+\startitemize
272293\item
273294 Minus 1
274295
@@ -278,195 +299,219 @@ Minuses loose:
278299\item
279300 Minus 3
280301
281−\stopltxitem
302+\stopitemize
303+
282304\subsubject{Ordered}
283305
284306Tight:
285307
286−\startitemize
287−\sym{1.}
308+\startitemize[n][stopper=.]
309+\item
288310 First
289−\sym{2.}
311+\item
290312 Second
291−\sym{3.}
313+\item
292314 Third
293315\stopitemize
316+
294317and:
295318
296−\startitemize
297−\sym{1.}
319+\startitemize[n][stopper=.]
320+\item
298321 One
299−\sym{2.}
322+\item
300323 Two
301−\sym{3.}
324+\item
302325 Three
303326\stopitemize
327+
304328Loose using tabs:
305329
306−\startitemize
307−\sym{1.}
330+\startitemize[n][stopper=.]
331+\item
308332 First
309333
310−\sym{2.}
334+\item
311335 Second
312336
313−\sym{3.}
337+\item
314338 Third
315339
316340\stopitemize
341+
317342and using spaces:
318343
319−\startitemize
320−\sym{1.}
344+\startitemize[n][stopper=.]
345+\item
321346 One
322347
323−\sym{2.}
348+\item
324349 Two
325350
326−\sym{3.}
351+\item
327352 Three
328353
329354\stopitemize
355+
330356Multiple paragraphs:
331357
332−\startitemize
333−\sym{1.}
358+\startitemize[n][stopper=.]
359+\item
334360 Item 1, graf one.
335361
336362 Item 1. graf two. The quick brown fox jumped over the lazy dog's
337363 back.
338364
339−\sym{2.}
365+\item
340366 Item 2.
341367
342−\sym{3.}
368+\item
343369 Item 3.
344370
345371\stopitemize
372+
346373\subsubject{Nested}
347374
348−\startltxitem
375+\startitemize
349376\item
350377 Tab
351− \startltxitem
378+ \startitemize
352379 \item
353380 Tab
354− \startltxitem
381+ \startitemize
355382 \item
356383 Tab
357− \stopltxitem
358− \stopltxitem
359−\stopltxitem
384+ \stopitemize
385+
386+ \stopitemize
387+
388+\stopitemize
389+
360390Here's another:
361391
362−\startitemize
363−\sym{1.}
392+\startitemize[n][stopper=.]
393+\item
364394 First
365−\sym{2.}
395+\item
366396 Second:
367− \startltxitem
397+ \startitemize
368398 \item
369399 Fee
370400 \item
371401 Fie
372402 \item
373403 Foe
374− \stopltxitem
375−\sym{3.}
404+ \stopitemize
405+
406+\item
376407 Third
377408\stopitemize
409+
378410Same thing but with paragraphs:
379411
380−\startitemize
381−\sym{1.}
412+\startitemize[n][stopper=.]
413+\item
382414 First
383415
384−\sym{2.}
416+\item
385417 Second:
386418
387− \startltxitem
419+ \startitemize
388420 \item
389421 Fee
390422 \item
391423 Fie
392424 \item
393425 Foe
394− \stopltxitem
395−\sym{3.}
426+ \stopitemize
427+
428+\item
396429 Third
397430
398431\stopitemize
432+
399433\subsubject{Tabs and spaces}
400434
401−\startltxitem
435+\startitemize
402436\item
403437 this is a list item indented with tabs
404438
405439\item
406440 this is a list item indented with spaces
407441
408− \startltxitem
442+ \startitemize
409443 \item
410444 this is an example list item indented with tabs
411445
412446 \item
413447 this is an example list item indented with spaces
414448
415− \stopltxitem
416−\stopltxitem
449+ \stopitemize
450+
451+\stopitemize
452+
417453\subsubject{Fancy list markers}
418454
419−\startitemize[width=2em]
420−\sym{(2)}
455+\startitemize[n][start=2,left=(,stopper=),width=2.0em]
456+\item
421457 begins with 2
422−\sym{(3)}
458+\item
423459 and now 3
424460
425461 with a continuation
426462
427− \startitemize[width=2em]
428− \sym{iv.}
463+ \startitemize[r][start=4,stopper=.,width=2.0em]
464+ \item
429465 sublist with roman numerals, starting with 4
430− \sym{v.}
466+ \item
431467 more items
432− \startitemize[width=2em]
433− \sym{(A)}
468+ \startitemize[A][left=(,stopper=),width=2.0em]
469+ \item
434470 a subsublist
435− \sym{(B)}
471+ \item
436472 a subsublist
437473 \stopitemize
474+
438475 \stopitemize
476+
439477\stopitemize
478+
440479Nesting:
441480
442−\startitemize
443−\sym{A.}
481+\startitemize[A][stopper=.]
482+\item
444483 Upper Alpha
445− \startitemize
446− \sym{I.}
484+ \startitemize[R][stopper=.]
485+ \item
447486 Upper Roman.
448− \startitemize[width=2em]
449− \sym{(6)}
487+ \startitemize[n][start=6,left=(,stopper=),width=2.0em]
488+ \item
450489 Decimal start with 6
451− \startitemize
452− \sym{c)}
490+ \startitemize[a][start=3,stopper=)]
491+ \item
453492 Lower alpha with paren
454493 \stopitemize
494+
455495 \stopitemize
496+
456497 \stopitemize
498+
457499\stopitemize
500+
458501Autonumbering:
459502
460−\startltxenum
503+\startitemize[n]
461504\item
462505 Autonumber.
463506\item
464507 More.
465− \startltxenum
508+ \startitemize[a]
466509 \item
467510 Nested.
468− \stopltxenum
469−\stopltxenum
511+ \stopitemize
512+
513+\stopitemize
514+
470515Should not be a list item:
471516
472517M.A. 2007
@@ -532,6 +577,7 @@ orange fruit
532577\stoptyping
533578
534579\startblockquote
580+
535581orange block quote
536582
537583\stopblockquote
@@ -651,7 +697,7 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
651697
652698Here is some unicode:
653699
654−\startltxitem
700+\startitemize
655701\item
656702 I hat: Î
657703\item
@@ -662,7 +708,8 @@ Here is some unicode:
662708 set membership: ∈
663709\item
664710 copyright: ©
665−\stopltxitem
711+\stopitemize
712+
666713AT\&T has an ampersand in their name.
667714
668715AT\&T is another way to write it.
@@ -776,18 +823,20 @@ Here's an
776823With an ampersand:
777824\useurl[27][http://example.com/?foo=1&bar=2][][http://example.com/?foo=1\&bar=2]\from[27]
778825
779−\startltxitem
826+\startitemize
780827\item
781828 In a list?
782829\item
783830 \useurl[28][http://example.com/][][http://example.com/]\from[28]
784831\item
785832 It should.
786−\stopltxitem
833+\stopitemize
834+
787835An e-mail address:
788836\useurl[29][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[29]
789837
790838\startblockquote
839+
791840Blockquoted:
792841\useurl[30][http://example.com/][][http://example.com/]\from[30]
793842
@@ -843,15 +892,17 @@ a space.[\letterhat{}my note] Here is an inline note.
843892verbatim characters, as well as [bracketed text].}
844893
845894\startblockquote
895+
846896Notes can go in quotes.
847897 \footnote{In quote.}
848898
849899\stopblockquote
850−\startitemize
851−\sym{1.}
900+\startitemize[n][stopper=.]
901+\item
852902 And in list items.
853903 \footnote{In list.}
854904\stopitemize
905+
855906This paragraph should not be part of the note, as it is not
856907indented.
857908