Ms writer: improved pdf metadata.

This commit is contained in:
John MacFarlane 2017-03-25 19:30:24 +01:00
parent 7d3d5387ac
commit c941a00cac
3 changed files with 8 additions and 2 deletions

View file

@ -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$

View file

@ -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

View file

@ -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 ||