aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/default.ms3
-rw-r--r--src/Text/Pandoc/Writers/Ms.hs4
-rw-r--r--test/writer.ms3
3 files changed, 8 insertions, 2 deletions
diff --git a/data/templates/default.ms b/data/templates/default.ms
index 8d4d0a052..acffb5f6a 100644
--- a/data/templates/default.ms
+++ b/data/templates/default.ms
@@ -39,7 +39,8 @@
.\" ***************************************************************
.\" PDF metadata
.mso pdfmark.tmac
-.pdfinfo /Title $title$
+.pdfinfo /Title "$title-meta$"
+.pdfinfo /Author "$author-meta$"
$if(adjusting)$
.ad $adjusting$
$endif$
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
index 6e8c1bd63..7d0c278a6 100644
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -117,11 +117,15 @@ pandocToMs opts (Pandoc meta blocks) = do
body <- blockListToMs opts blocks
let main = render' body
hasInlineMath <- gets stHasInlineMath
+ let titleMeta = (escapeString . stringify) $ docTitle meta
+ let authorsMeta = map (escapeString . stringify) $ docAuthors meta
let context = defField "body" main
$ defField "has-inline-math" hasInlineMath
$ defField "hyphenate" True
$ defField "pandoc-version" pandocVersion
$ defField "toc" (writerTableOfContents opts)
+ $ defField "title-meta" titleMeta
+ $ defField "author-meta" (intercalate "; " authorsMeta)
$ metadata
case writerTemplate opts of
Nothing -> return main
diff --git a/test/writer.ms b/test/writer.ms
index 969407909..03512cbb4 100644
--- a/test/writer.ms
+++ b/test/writer.ms
@@ -39,7 +39,8 @@
.\" ***************************************************************
.\" PDF metadata
.mso pdfmark.tmac
-.pdfinfo /Title Pandoc Test Suite
+.pdfinfo /Title "Pandoc Test Suite"
+.pdfinfo /Author "John MacFarlane; Anonymous"
.hy
.EQ
delim ||