git.iko.soy/typeable/pandoc
on master help sign in
Ms writer: Improved footnotes.
commit1809f64a4cacdfe4bb7463b52181ceb74502ccd9 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 23 Mar 2017, 11:56 (10 years ago) parentda0aae9
2 files changed+7−7
src/Text/Pandoc/Writers/Ms.hs+7−2 test/writer.ms−5
src/Text/Pandoc/Writers/Ms.hs+7−2
@@ -57,7 +57,7 @@ TODO:
5757 A big advantage of gropdf: it supports the tag
5858 \X'pdf: pdfpic file alignment width height line-length'
5959 and also seems to support bookmarks.
60−[ ] avoid blank line after footnote marker when footnote has a
60+[x] avoid blank line after footnote marker when footnote has a
6161 paragraph
6262[ ] better smallcaps support, see below...
6363[ ] add via groff option to PDF module
@@ -448,7 +448,12 @@ handleNotes opts fallback = do
448448
449449handleNote :: PandocMonad m => WriterOptions -> Note -> MS m Doc
450450handleNote opts bs = do
451− contents <- blockListToMs opts bs
451+ -- don't start with Paragraph or we'll get a spurious blank
452+ -- line after the note ref:
453+ let bs' = case bs of
454+ (Para ils : rest) -> Plain ils : rest
455+ _ -> bs
456+ contents <- blockListToMs opts bs'
452457 return $ cr <> text ".FS" $$ contents $$ text ".FE" <> cr
453458
454459fontChange :: PandocMonad m => MS m Doc
test/writer.ms−5
@@ -883,7 +883,6 @@ Footnotes
883883.LP
884884Here is a footnote reference,\**
885885.FS
886−.LP
887886Here is the footnote.
888887It can go anywhere after the footnote
889888reference.
@@ -891,7 +890,6 @@ It need not be placed at the end of the document.
891890.FE
892891and another.\**
893892.FS
894−.LP
895893Here's the long note.
896894This one contains multiple
897895blocks.
@@ -911,7 +909,6 @@ lazy and just indent the first line of each block.
911909This should \f[I]not\f[] be a footnote reference, because it
912910contains a space.[^my note] Here is an inline note.\**
913911.FS
914−.LP
915912This
916913is \f[I]easier\f[] to type.
917914Inline notes may contain
@@ -926,14 +923,12 @@ as well as [bracketed text].
926923.LP
927924Notes can go in quotes.\**
928925.FS
929−.LP
930926In quote.
931927.FE
932928.RE
933929.IP "1." 3
934930And in list items.\**
935931.FS
936−.LP
937932In list.
938933.FE
939934.LP