git.iko.soy/typeable/pandoc
on master help sign in
Texinfo writer: Fixed internal cross-references.
4ab30f3John MacFarlane
src/Text/Pandoc/Writers/Texinfo.hs+26−7
@@ -45,6 +45,8 @@ data WriterState =
45 WriterState { stStrikeout :: Bool -- document contains strikeout
45 WriterState { stStrikeout :: Bool -- document contains strikeout
46 , stSuperscript :: Bool -- document contains superscript
46 , stSuperscript :: Bool -- document contains superscript
47 , stSubscript :: Bool -- document contains subscript
47 , stSubscript :: Bool -- document contains subscript
48+ , stEscapeComma :: Bool -- in a context where we need @comma
49+ , stIdentifiers :: [String] -- header ids used already
48 }
50 }
49
51
50{- TODO:
52{- TODO:
@@ -56,7 +58,8 @@ data WriterState =
56writeTexinfo :: WriterOptions -> Pandoc -> String
58writeTexinfo :: WriterOptions -> Pandoc -> String
57writeTexinfo options document =
59writeTexinfo options document =
58 evalState (pandocToTexinfo options $ wrapTop document) $
60 evalState (pandocToTexinfo options $ wrapTop document) $
59− WriterState { stStrikeout = False, stSuperscript = False, stSubscript = False }
61+ WriterState { stStrikeout = False, stSuperscript = False,
62+ stEscapeComma = False, stSubscript = False, stIdentifiers = [] }
60
63
61-- | Add a "Top" node around the document, needed by Texinfo.
64-- | Add a "Top" node around the document, needed by Texinfo.
62wrapTop :: Pandoc -> Pandoc
65wrapTop :: Pandoc -> Pandoc
@@ -95,7 +98,6 @@ stringToTexinfo = escapeStringUsing texinfoEscapes
95 where texinfoEscapes = [ ('{', "@{")
98 where texinfoEscapes = [ ('{', "@{")
96 , ('}', "@}")
99 , ('}', "@}")
97 , ('@', "@@")
100 , ('@', "@@")
98− , (',', "@comma{}") -- only needed in argument lists
99 , ('\160', "@ ")
101 , ('\160', "@ ")
100 , ('\x2014', "---")
102 , ('\x2014', "---")
101 , ('\x2013', "--")
103 , ('\x2013', "--")
@@ -103,6 +105,14 @@ stringToTexinfo = escapeStringUsing texinfoEscapes
103 , ('\x2019', "'")
105 , ('\x2019', "'")
104 ]
106 ]
105
107
108+escapeCommas :: State WriterState Doc -> State WriterState Doc
109+escapeCommas parser = do
110+ oldEscapeComma <- gets stEscapeComma
111+ modify $ \st -> st{ stEscapeComma = True }
112+ res <- parser
113+ modify $ \st -> st{ stEscapeComma = oldEscapeComma }
114+ return res
115+
106-- | Puts contents into Texinfo command.
116-- | Puts contents into Texinfo command.
107inCmd :: String -> Doc -> Doc
117inCmd :: String -> Doc -> Doc
108inCmd cmd contents = char '@' <> text cmd <> braces contents
118inCmd cmd contents = char '@' <> text cmd <> braces contents
@@ -134,7 +144,8 @@ blockToTexinfo (BlockQuote lst) = do
134 text "@end quotation"
144 text "@end quotation"
135
145
136blockToTexinfo (CodeBlock _ str) = do
146blockToTexinfo (CodeBlock _ str) = do
147+ return $ blankline $$
137− return $ text "@verbatim" $$
148+ text "@verbatim" $$
138 flush (text str) $$
149 flush (text str) $$
139 text "@end verbatim" <> blankline
150 text "@end verbatim" <> blankline
140
151
@@ -194,9 +205,13 @@ blockToTexinfo (Header 0 lst) = do
194blockToTexinfo (Header level lst) = do
205blockToTexinfo (Header level lst) = do
195 node <- inlineListForNode lst
206 node <- inlineListForNode lst
196 txt <- inlineListToTexinfo lst
207 txt <- inlineListToTexinfo lst
208+ idsUsed <- gets stIdentifiers
209+ let id' = uniqueIdent lst idsUsed
210+ modify $ \st -> st{ stIdentifiers = id' : idsUsed }
197 return $ if (level > 0) && (level <= 4)
211 return $ if (level > 0) && (level <= 4)
198− then blankline <> text "@node " <> node <> cr <>
212+ then blankline <> text "@node " <> node $$
199− text (seccmd level) <> txt
213+ text (seccmd level) <> txt $$
214+ text "@anchor" <> braces (text $ '#':id')
200 else txt
215 else txt
201 where
216 where
202 seccmd 1 = "@chapter "
217 seccmd 1 = "@chapter "
@@ -404,17 +419,21 @@ inlineToTexinfo (RawInline _ _) = return empty
404inlineToTexinfo (LineBreak) = return $ text "@*"
419inlineToTexinfo (LineBreak) = return $ text "@*"
405inlineToTexinfo Space = return $ char ' '
420inlineToTexinfo Space = return $ char ' '
406
421
422+inlineToTexinfo (Link txt (src@('#':_), _)) = do
423+ contents <- escapeCommas $ inlineListToTexinfo txt
424+ return $ text "@ref" <>
425+ braces (text (stringToTexinfo src) <> text "," <> contents)
407inlineToTexinfo (Link txt (src, _)) = do
426inlineToTexinfo (Link txt (src, _)) = do
408 case txt of
427 case txt of
409 [Code _ x] | x == src -> -- autolink
428 [Code _ x] | x == src -> -- autolink
410 do return $ text $ "@url{" ++ x ++ "}"
429 do return $ text $ "@url{" ++ x ++ "}"
411− _ -> do contents <- inlineListToTexinfo txt
430+ _ -> do contents <- escapeCommas $ inlineListToTexinfo txt
412 let src1 = stringToTexinfo src
431 let src1 = stringToTexinfo src
413 return $ text ("@uref{" ++ src1 ++ ",") <> contents <>
432 return $ text ("@uref{" ++ src1 ++ ",") <> contents <>
414 char '}'
433 char '}'
415
434
416inlineToTexinfo (Image alternate (source, _)) = do
435inlineToTexinfo (Image alternate (source, _)) = do
417− content <- inlineListToTexinfo alternate
436+ content <- escapeCommas $ inlineListToTexinfo alternate
418 return $ text ("@image{" ++ base ++ ",,,") <> content <> text "," <>
437 return $ text ("@image{" ++ base ++ ",,,") <> content <> text "," <>
419 text (ext ++ "}")
438 text (ext ++ "}")
420 where
439 where
tests/writer.texinfo+67−26
@@ -30,7 +30,7 @@ _@{\text\@}
30@title Pandoc Test Suite
30@title Pandoc Test Suite
31@author John MacFarlane
31@author John MacFarlane
32@author Anonymous
32@author Anonymous
33−July 17@comma{} 2006
33+July 17, 2006
34@end titlepage
34@end titlepage
35
35
36@node Top
36@node Top
@@ -64,28 +64,33 @@ This is a set of tests for pandoc. Most of them are adapted from John Gruber's m
64
64
65@node Headers
65@node Headers
66@chapter Headers
66@chapter Headers
67+@anchor{#headers}
67@menu
68@menu
68* Level 2 with an embedded link::
69* Level 2 with an embedded link::
69@end menu
70@end menu
70
71
71@node Level 2 with an embedded link
72@node Level 2 with an embedded link
72@section Level 2 with an @uref{/url,embedded link}
73@section Level 2 with an @uref{/url,embedded link}
74+@anchor{#level-2-with-an-embedded-link}
73@menu
75@menu
74* Level 3 with emphasis::
76* Level 3 with emphasis::
75@end menu
77@end menu
76
78
77@node Level 3 with emphasis
79@node Level 3 with emphasis
78@subsection Level 3 with @emph{emphasis}
80@subsection Level 3 with @emph{emphasis}
81+@anchor{#level-3-with-emphasis}
79@menu
82@menu
80* Level 4::
83* Level 4::
81@end menu
84@end menu
82
85
83@node Level 4
86@node Level 4
84@subsubsection Level 4
87@subsubsection Level 4
88+@anchor{#level-4}
85Level 5
89Level 5
86
90
87@node Level 1
91@node Level 1
88@chapter Level 1
92@chapter Level 1
93+@anchor{#level-1}
89@menu
94@menu
90* Level 2 with emphasis::
95* Level 2 with emphasis::
91* Level 2::
96* Level 2::
@@ -93,16 +98,19 @@ Level 5
93
98
94@node Level 2 with emphasis
99@node Level 2 with emphasis
95@section Level 2 with @emph{emphasis}
100@section Level 2 with @emph{emphasis}
101+@anchor{#level-2-with-emphasis}
96@menu
102@menu
97* Level 3::
103* Level 3::
98@end menu
104@end menu
99
105
100@node Level 3
106@node Level 3
101@subsection Level 3
107@subsection Level 3
108+@anchor{#level-3}
102with no blank line
109with no blank line
103
110
104@node Level 2
111@node Level 2
105@section Level 2
112@section Level 2
113+@anchor{#level-2}
106with no blank line
114with no blank line
107
115
108@iftex
116@iftex
@@ -114,6 +122,7 @@ with no blank line
114
122
115@node Paragraphs
123@node Paragraphs
116@chapter Paragraphs
124@chapter Paragraphs
125+@anchor{#paragraphs}
117Here's a regular paragraph.
126Here's a regular paragraph.
118
127
119In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.
128In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.
@@ -131,6 +140,7 @@ There should be a hard line break@*here.
131
140
132@node Block Quotes
141@node Block Quotes
133@chapter Block Quotes
142@chapter Block Quotes
143+@anchor{#block-quotes}
134E-mail style:
144E-mail style:
135
145
136@quotation
146@quotation
@@ -138,6 +148,7 @@ This is a block quote. It is pretty short.
138@end quotation
148@end quotation
139@quotation
149@quotation
140Code in a block quote:
150Code in a block quote:
151+
141@verbatim
152@verbatim
142sub status {
153sub status {
143 print "working";
154 print "working";
@@ -175,7 +186,9 @@ And a following paragraph.
175
186
176@node Code Blocks
187@node Code Blocks
177@chapter Code Blocks
188@chapter Code Blocks
189+@anchor{#code-blocks}
178Code:
190Code:
191+
179@verbatim
192@verbatim
180---- (should be four hyphens)
193---- (should be four hyphens)
181
194
@@ -187,6 +200,7 @@ this code block is indented by one tab
187@end verbatim
200@end verbatim
188
201
189And:
202And:
203+
190@verbatim
204@verbatim
191 this code block is indented by two tabs
205 this code block is indented by two tabs
192
206
@@ -202,6 +216,7 @@ These should not be escaped: \$ \\ \> \[ \{
202
216
203@node Lists
217@node Lists
204@chapter Lists
218@chapter Lists
219+@anchor{#lists}
205@menu
220@menu
206* Unordered::
221* Unordered::
207* Ordered::
222* Ordered::
@@ -212,6 +227,7 @@ These should not be escaped: \$ \\ \> \[ \{
212
227
213@node Unordered
228@node Unordered
214@section Unordered
229@section Unordered
230+@anchor{#unordered}
215Asterisks tight:
231Asterisks tight:
216
232
217@itemize
233@itemize
@@ -289,6 +305,7 @@ Minus 3
289
305
290@node Ordered
306@node Ordered
291@section Ordered
307@section Ordered
308+@anchor{#ordered}
292Tight:
309Tight:
293
310
294@enumerate
311@enumerate
@@ -343,7 +360,7 @@ Multiple paragraphs:
343
360
344@enumerate
361@enumerate
345@item
362@item
346−Item 1@comma{} graf one.
363+Item 1, graf one.
347
364
348Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
365Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
349
366
@@ -357,6 +374,7 @@ Item 3.
357
374
358@node Nested
375@node Nested
359@section Nested
376@section Nested
377+@anchor{#nested}
360@itemize
378@itemize
361@item
379@item
362Tab
380Tab
@@ -417,6 +435,7 @@ Third
417
435
418@node Tabs and spaces
436@node Tabs and spaces
419@section Tabs and spaces
437@section Tabs and spaces
438+@anchor{#tabs-and-spaces}
420@itemize
439@itemize
421@item
440@item
422this is a list item indented with tabs
441this is a list item indented with tabs
@@ -437,6 +456,7 @@ this is an example list item indented with spaces
437
456
438@node Fancy list markers
457@node Fancy list markers
439@section Fancy list markers
458@section Fancy list markers
459+@anchor{#fancy-list-markers}
440@enumerate 2
460@enumerate 2
441@item
461@item
442begins with 2
462begins with 2
@@ -447,7 +467,7 @@ with a continuation
447
467
448@enumerate 4
468@enumerate 4
449@item
469@item
450−sublist with roman numerals@comma{} starting with 4
470+sublist with roman numerals, starting with 4
451@item
471@item
452more items
472more items
453@enumerate A
473@enumerate A
@@ -512,6 +532,7 @@ B. Williams
512
532
513@node Definition Lists
533@node Definition Lists
514@chapter Definition Lists
534@chapter Definition Lists
535+@anchor{#definition-lists}
515Tight using spaces:
536Tight using spaces:
516
537
517@table @asis
538@table @asis
@@ -564,11 +585,12 @@ Multiple blocks with italics:
564
585
565red fruit
586red fruit
566
587
567−contains seeds@comma{} crisp@comma{} pleasant to taste
588+contains seeds, crisp, pleasant to taste
568
589
569@item @emph{orange}
590@item @emph{orange}
570
591
571orange fruit
592orange fruit
593+
572@verbatim
594@verbatim
573{ orange code block }
595{ orange code block }
574@end verbatim
596@end verbatim
@@ -578,7 +600,7 @@ orange block quote
578@end quotation
600@end quotation
579@end table
601@end table
580
602
581−Multiple definitions@comma{} tight:
603+Multiple definitions, tight:
582
604
583@table @asis
605@table @asis
584@item apple
606@item apple
@@ -591,7 +613,7 @@ orange fruit
591bank
613bank
592@end table
614@end table
593
615
594−Multiple definitions@comma{} loose:
616+Multiple definitions, loose:
595
617
596@table @asis
618@table @asis
597@item apple
619@item apple
@@ -608,7 +630,7 @@ bank
608
630
609@end table
631@end table
610
632
611−Blank line after term@comma{} indented marker@comma{} alternate markers:
633+Blank line after term, indented marker, alternate markers:
612
634
613@table @asis
635@table @asis
614@item apple
636@item apple
@@ -632,6 +654,7 @@ sublist
632
654
633@node HTML Blocks
655@node HTML Blocks
634@chapter HTML Blocks
656@chapter HTML Blocks
657+@anchor{#html-blocks}
635Simple block on one line:
658Simple block on one line:
636
659
637foo
660foo
@@ -646,7 +669,8 @@ And this is @strong{strong}
646Here's a simple block:
669Here's a simple block:
647
670
648foo
671foo
649−This should be a code block@comma{} though:
672+This should be a code block, though:
673+
650@verbatim
674@verbatim
651<div>
675<div>
652 foo
676 foo
@@ -654,11 +678,12 @@ This should be a code block@comma{} though:
654@end verbatim
678@end verbatim
655
679
656As should this:
680As should this:
681+
657@verbatim
682@verbatim
658<div>foo</div>
683<div>foo</div>
659@end verbatim
684@end verbatim
660
685
661−Now@comma{} nested:
686+Now, nested:
662
687
663foo
688foo
664This should just be an HTML comment:
689This should just be an HTML comment:
@@ -666,13 +691,15 @@ This should just be an HTML comment:
666Multiline:
691Multiline:
667
692
668Code block:
693Code block:
694+
669@verbatim
695@verbatim
670<!-- Comment -->
696<!-- Comment -->
671@end verbatim
697@end verbatim
672
698
673−Just plain comment@comma{} with trailing spaces on the line:
699+Just plain comment, with trailing spaces on the line:
674
700
675Code:
701Code:
702+
676@verbatim
703@verbatim
677<hr />
704<hr />
678@end verbatim
705@end verbatim
@@ -688,9 +715,10 @@ Hr's:
688
715
689@node Inline Markup
716@node Inline Markup
690@chapter Inline Markup
717@chapter Inline Markup
718+@anchor{#inline-markup}
691−This is @emph{emphasized}@comma{} and so @emph{is this}.
719+This is @emph{emphasized}, and so @emph{is this}.
692
720
693−This is @strong{strong}@comma{} and so @strong{is this}.
721+This is @strong{strong}, and so @strong{is this}.
694
722
695An @emph{@uref{/url,emphasized link}}.
723An @emph{@uref{/url,emphasized link}}.
696
724
@@ -702,15 +730,15 @@ So is @strong{@emph{this}} word.
702
730
703So is @strong{@emph{this}} word.
731So is @strong{@emph{this}} word.
704
732
705−This is code: @code{>}@comma{} @code{$}@comma{} @code{\}@comma{} @code{\$}@comma{} @code{<html>}.
733+This is code: @code{>}, @code{$}, @code{\}, @code{\$}, @code{<html>}.
706
734
707@textstrikeout{This is @emph{strikeout}.}
735@textstrikeout{This is @emph{strikeout}.}
708
736
709Superscripts: a@textsuperscript{bc}d a@textsuperscript{@emph{hello}} a@textsuperscript{hello@ there}.
737Superscripts: a@textsuperscript{bc}d a@textsuperscript{@emph{hello}} a@textsuperscript{hello@ there}.
710
738
711−Subscripts: H@textsubscript{2}O@comma{} H@textsubscript{23}O@comma{} H@textsubscript{many@ of@ them}O.
739+Subscripts: H@textsubscript{2}O, H@textsubscript{23}O, H@textsubscript{many@ of@ them}O.
712
740
713−These should not be superscripts or subscripts@comma{} because of the unescaped spaces: a^b c^d@comma{} a~b c~d.
741+These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
714
742
715@iftex
743@iftex
716@bigskip@hrule@bigskip
744@bigskip@hrule@bigskip
@@ -720,20 +748,21 @@ These should not be superscripts or subscripts@comma{} because of the unescaped
720@end ifnottex
748@end ifnottex
721
749
722@node Smart quotes ellipses dashes
750@node Smart quotes ellipses dashes
723−@chapter Smart quotes@comma{} ellipses@comma{} dashes
751+@chapter Smart quotes, ellipses, dashes
752+@anchor{#smart-quotes-ellipses-dashes}
724−``Hello@comma{}'' said the spider. ```Shelob' is my name.''
753+``Hello,'' said the spider. ```Shelob' is my name.''
725
754
726−`A'@comma{} `B'@comma{} and `C' are letters.
755+`A', `B', and `C' are letters.
727
756
728−`Oak@comma{}' `elm@comma{}' and `beech' are names of trees. So is `pine.'
757+`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
729
758
730−`He said@comma{} ``I want to go.''' Were you alive in the 70's?
759+`He said, ``I want to go.''' Were you alive in the 70's?
731
760
732Here is some quoted `@code{code}' and a ``@uref{http://example.com/?foo=1&bar=2,quoted link}''.
761Here is some quoted `@code{code}' and a ``@uref{http://example.com/?foo=1&bar=2,quoted link}''.
733
762
734Some dashes: one---two --- three---four --- five.
763Some dashes: one---two --- three---four --- five.
735
764
736−Dashes between numbers: 5--7@comma{} 255--66@comma{} 1987--1999.
765+Dashes between numbers: 5--7, 255--66, 1987--1999.
737
766
738Ellipses@dots{}and@dots{}and@dots{}.
767Ellipses@dots{}and@dots{}and@dots{}.
739
768
@@ -746,6 +775,7 @@ Ellipses@dots{}and@dots{}and@dots{}.
746
775
747@node LaTeX
776@node LaTeX
748@chapter LaTeX
777@chapter LaTeX
778+@anchor{#latex}
749@itemize
779@itemize
750@item
780@item
751@tex
781@tex
@@ -771,9 +801,9 @@ These shouldn't be math:
771
801
772@itemize
802@itemize
773@item
803@item
774−To get the famous equation@comma{} write @code{$e = mc^2$}.
804+To get the famous equation, write @code{$e = mc^2$}.
775@item
805@item
776−$22@comma{}000 is a @emph{lot} of money. So is $34@comma{}000. (It worked if ``lot'' is emphasized.)
806+$22,000 is a @emph{lot} of money. So is $34,000. (It worked if ``lot'' is emphasized.)
777@item
807@item
778Shoes ($20) and socks ($5).
808Shoes ($20) and socks ($5).
779@item
809@item
@@ -798,6 +828,7 @@ Cat & 1 \\ \hline
798
828
799@node Special Characters
829@node Special Characters
800@chapter Special Characters
830@chapter Special Characters
831+@anchor{#special-characters}
801Here is some unicode:
832Here is some unicode:
802
833
803@itemize
834@itemize
@@ -864,6 +895,7 @@ Minus: -
864
895
865@node Links
896@node Links
866@chapter Links
897@chapter Links
898+@anchor{#links}
867@menu
899@menu
868* Explicit::
900* Explicit::
869* Reference::
901* Reference::
@@ -873,6 +905,7 @@ Minus: -
873
905
874@node Explicit
906@node Explicit
875@section Explicit
907@section Explicit
908+@anchor{#explicit}
876Just a @uref{/url/,URL}.
909Just a @uref{/url/,URL}.
877
910
878@uref{/url/,URL and title}.
911@uref{/url/,URL and title}.
@@ -893,6 +926,7 @@ Just a @uref{/url/,URL}.
893
926
894@node Reference
927@node Reference
895@section Reference
928@section Reference
929+@anchor{#reference}
896Foo @uref{/url/,bar}.
930Foo @uref{/url/,bar}.
897
931
898Foo @uref{/url/,bar}.
932Foo @uref{/url/,bar}.
@@ -910,6 +944,7 @@ Indented @uref{/url,twice}.
910Indented @uref{/url,thrice}.
944Indented @uref{/url,thrice}.
911
945
912This should [not][] be a link.
946This should [not][] be a link.
947+
913@verbatim
948@verbatim
914[not]: /url
949[not]: /url
915@end verbatim
950@end verbatim
@@ -920,6 +955,7 @@ Foo @uref{/url/,biz}.
920
955
921@node With ampersands
956@node With ampersands
922@section With ampersands
957@section With ampersands
958+@anchor{#with-ampersands}
923Here's a @uref{http://example.com/?foo=1&bar=2,link with an ampersand in the URL}.
959Here's a @uref{http://example.com/?foo=1&bar=2,link with an ampersand in the URL}.
924
960
925Here's a link with an amersand in the link text: @uref{http://att.com/,AT&T}.
961Here's a link with an amersand in the link text: @uref{http://att.com/,AT&T}.
@@ -930,6 +966,7 @@ Here's an @uref{/script?foo=1&bar=2,inline link in pointy braces}.
930
966
931@node Autolinks
967@node Autolinks
932@section Autolinks
968@section Autolinks
969+@anchor{#autolinks}
933With an ampersand: @url{http://example.com/?foo=1&bar=2}
970With an ampersand: @url{http://example.com/?foo=1&bar=2}
934
971
935@itemize
972@itemize
@@ -947,6 +984,7 @@ An e-mail address: @uref{mailto:nobody@@nowhere.net,@code{nobody@@nowhere.net}}
947Blockquoted: @url{http://example.com/}
984Blockquoted: @url{http://example.com/}
948@end quotation
985@end quotation
949Auto-links should not occur here: @code{<http://example.com/>}
986Auto-links should not occur here: @code{<http://example.com/>}
987+
950@verbatim
988@verbatim
951or here: <http://example.com/>
989or here: <http://example.com/>
952@end verbatim
990@end verbatim
@@ -960,6 +998,7 @@ or here: <http://example.com/>
960
998
961@node Images
999@node Images
962@chapter Images
1000@chapter Images
1001+@anchor{#images}
963From ``Voyage dans la Lune'' by Georges Melies (1902):
1002From ``Voyage dans la Lune'' by Georges Melies (1902):
964
1003
965@float
1004@float
@@ -978,14 +1017,16 @@ Here is a movie @image{movie,,,movie,jpg} icon.
978
1017
979@node Footnotes
1018@node Footnotes
980@chapter Footnotes
1019@chapter Footnotes
1020+@anchor{#footnotes}
981−Here is a footnote reference@comma{}@footnote{Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.} and another.@footnote{Here's the long note. This one contains multiple blocks.
1021+Here is a footnote reference,@footnote{Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.} and another.@footnote{Here's the long note. This one contains multiple blocks.
982
1022
983Subsequent blocks are indented to show that they belong to the footnote (as with list items).
1023Subsequent blocks are indented to show that they belong to the footnote (as with list items).
1024+
984@verbatim
1025@verbatim
985 { <code> }
1026 { <code> }
986@end verbatim
1027@end verbatim
987
1028
988−If you want@comma{} you can indent every line@comma{} but you can also be lazy and just indent the first line of each block.} This should @emph{not} be a footnote reference@comma{} because it contains a space.[^my note] Here is an inline note.@footnote{This is @emph{easier} to type. Inline notes may contain @uref{http://google.com,links} and @code{]} verbatim characters@comma{} as well as [bracketed text].}
1029+If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.} This should @emph{not} be a footnote reference, because it contains a space.[^my note] Here is an inline note.@footnote{This is @emph{easier} to type. Inline notes may contain @uref{http://google.com,links} and @code{]} verbatim characters, as well as [bracketed text].}
989
1030
990@quotation
1031@quotation
991Notes can go in quotes.@footnote{In quote.}
1032Notes can go in quotes.@footnote{In quote.}
@@ -995,6 +1036,6 @@ Notes can go in quotes.@footnote{In quote.}
995And in list items.@footnote{In list.}
1036And in list items.@footnote{In list.}
996@end enumerate
1037@end enumerate
997
1038
998−This paragraph should not be part of the note@comma{} as it is not indented.
1039+This paragraph should not be part of the note, as it is not indented.
999
1040
1000@bye
1041@bye