git.iko.soy/typeable/pandoc
on master help sign in
Ms writer: improved pdf metadata.
commitc941a00cac0655349b6c03618bc096ac07237779 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 25 Mar 2017, 19:30 (10 years ago) parent7d3d538
3 files changed+8−2
data/templates/default.ms+2−1 src/Text/Pandoc/Writers/Ms.hs+4 test/writer.ms+2−1
data/templates/default.ms+2−1
@@ -39,7 +39,8 @@
3939.\" ***************************************************************
4040.\" PDF metadata
4141.mso pdfmark.tmac
42−.pdfinfo /Title $title$
42+.pdfinfo /Title "$title-meta$"
43+.pdfinfo /Author "$author-meta$"
4344$if(adjusting)$
4445.ad $adjusting$
4546$endif$
src/Text/Pandoc/Writers/Ms.hs+4
@@ -117,11 +117,15 @@ pandocToMs opts (Pandoc meta blocks) = do
117117 body <- blockListToMs opts blocks
118118 let main = render' body
119119 hasInlineMath <- gets stHasInlineMath
120+ let titleMeta = (escapeString . stringify) $ docTitle meta
121+ let authorsMeta = map (escapeString . stringify) $ docAuthors meta
120122 let context = defField "body" main
121123 $ defField "has-inline-math" hasInlineMath
122124 $ defField "hyphenate" True
123125 $ defField "pandoc-version" pandocVersion
124126 $ defField "toc" (writerTableOfContents opts)
127+ $ defField "title-meta" titleMeta
128+ $ defField "author-meta" (intercalate "; " authorsMeta)
125129 $ metadata
126130 case writerTemplate opts of
127131 Nothing -> return main
test/writer.ms+2−1
@@ -39,7 +39,8 @@
3939.\" ***************************************************************
4040.\" PDF metadata
4141.mso pdfmark.tmac
42−.pdfinfo /Title Pandoc Test Suite
42+.pdfinfo /Title "Pandoc Test Suite"
43+.pdfinfo /Author "John MacFarlane; Anonymous"
4344.hy
4445.EQ
4546delim ||