From ed6249bd0b36613c293f9a7c5cb6df869d3b52e8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 25 Mar 2017 20:53:32 +0100 Subject: Ms writer: use light gray for strikeout. Pending groff definitions for striking out an arbitrary section of text (not just a few words). --- data/templates/default.ms | 2 ++ src/Text/Pandoc/Writers/Ms.hs | 4 +++- test/writer.ms | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/data/templates/default.ms b/data/templates/default.ms index acffb5f6a..f8175e97d 100644 --- a/data/templates/default.ms +++ b/data/templates/default.ms @@ -36,6 +36,8 @@ .nr FL \n[LL] .\" footnote point size .nr FPS (\n[PS] - 2000) +.\" color used for strikeout +.defcolor strikecolor rgb 0.7 0.7 0.7 .\" *************************************************************** .\" PDF metadata .mso pdfmark.tmac diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index 7d0c278a6..d5f323b5e 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -425,7 +425,9 @@ inlineToMs opts (Strong lst) = withFontFeature 'B' (inlineListToMs opts lst) inlineToMs opts (Strikeout lst) = do contents <- inlineListToMs opts lst - return $ text "[STRIKEOUT:" <> contents <> char ']' + -- we use grey color instead of strikeout, which seems quite + -- hard to do in groff for arbitrary bits of text + return $ text "\\m[strikecolor]" <> contents <> text "\\m[]" inlineToMs opts (Superscript lst) = do contents <- inlineListToMs opts lst return $ text "\\*{" <> contents <> text "\\*}" diff --git a/test/writer.ms b/test/writer.ms index 03512cbb4..0ce199fba 100644 --- a/test/writer.ms +++ b/test/writer.ms @@ -36,6 +36,8 @@ .nr FL \n[LL] .\" footnote point size .nr FPS (\n[PS] - 2000) +.\" color used for strikeout +.defcolor strikecolor rgb 0.2 0.2 0.2 .\" *************************************************************** .\" PDF metadata .mso pdfmark.tmac @@ -588,7 +590,7 @@ So is \f[B]\f[BI]this\f[B]\f[] word. This is code: \f[C]>\f[], \f[C]$\f[], \f[C]\\\f[], \f[C]\\$\f[], \f[C]\f[]. .PP -[STRIKEOUT:This is \f[I]strikeout\f[].] +\m[strikecolor]This is \f[I]strikeout\f[].\m[] .PP Superscripts: a\*{bc\*}d a\*{\f[I]hello\f[]\*} a\*{hello\ there\*}. .PP -- cgit v1.2.3