Ms writer: Super/subscript support.

Also added some macro definitions to default template
to support subscripts + better superscripts.
This commit is contained in:
John MacFarlane
2017-03-23 12:59:19 +01:00
parent 1af6faf2d4
commit d20d3a5dbb
2 changed files with 12 additions and 2 deletions
+10
View File
@@ -11,6 +11,16 @@ $if(has-inline-math)$
delim ||
.EN
$endif$
\" From https://lists.gnu.org/archive/html/groff/2012-07/msg00046.html
\" Superscripts (ex tmac.e) (current versions without extra line space)
.\" (reinstate commented versions to restore extra line space)
.\" .ds { \v'-0.3m'\x'-0.2m'\\s[\\n[.s]*8u/10u]
.ds { \v'-0.3m'\\s[\\n[.s]*9u/12u]
.ds } \s0\v'0.3m'
.\" Subscripts
.\" .ds < \v'0.3m'\x'0.2m'\s[\\n[.s]*8u/10u]
.ds < \v'0.3m'\s[\\n[.s]*9u/12u]
.ds > \s0\v'-0.3m'
$if(title)$
.TL
$title$
+2 -2
View File
@@ -397,10 +397,10 @@ inlineToMs opts (Strikeout lst) = do
return $ text "[STRIKEOUT:" <> contents <> char ']'
inlineToMs opts (Superscript lst) = do
contents <- inlineListToMs opts lst
return $ char '^' <> contents <> char '^'
return $ text "\\*{" <> contents <> text "\\*}"
inlineToMs opts (Subscript lst) = do
contents <- inlineListToMs opts lst
return $ char '~' <> contents <> char '~'
return $ text "\\*<" <> contents <> text "\\*>"
inlineToMs opts (SmallCaps lst) = do
-- see https://lists.gnu.org/archive/html/groff/2015-01/msg00016.html
modify $ \st -> st{ stSmallCaps = not (stSmallCaps st) }