git.iko.soy/typeable/pandoc
on master help sign in
Ms writer improvements:
48729f9John MacFarlane
MANUAL.txt+15
@@ -1508,6 +1508,21 @@ Variables for man pages
1508`hyphenate`
1508`hyphenate`
1509: if `true` (the default), hyphenation will be used
1509: if `true` (the default), hyphenation will be used
1510
1510
1511+Variables for ms
1512+----------------
1513+
1514+`pointsize`
1515+: point size (e.g. `10p`)
1516+
1517+`lineheight`
1518+: line height (e.g. `12p`)
1519+
1520+`fontfamily`
1521+: font family (e.g. `T` or `P`)
1522+
1523+`indent`
1524+: paragraph indent (e.g. `2m`)
1525+
1511Using variables in templates
1526Using variables in templates
1512----------------------------
1527----------------------------
1513
1528
data/templates/default.ms+4−4
@@ -27,13 +27,13 @@ $endif$
27.\" header/footer width
27.\" header/footer width
28.nr LT \n[LL]
28.nr LT \n[LL]
29.\" point size
29.\" point size
30−.nr PS 10p
30+.nr PS $if(pointsize)$$pointsize$$else$10p$endif$
31.\" line height
31.\" line height
32−.nr VS 12p
32+.nr VS $if(lineheight)$$lineheight$$else$12p$endif$
33.\" font family: A, BM, H, HN, N, P, T, ZCM
33.\" font family: A, BM, H, HN, N, P, T, ZCM
34−.fam T
34+.fam $if(fontfamily)$$fontfamily$$else$T$endif$
35.\" paragraph indent
35.\" paragraph indent
36−.nr PI 2m
36+.nr PI $if(indent)$$indent$$else$2m$endif$
37.\" interparagraph space
37.\" interparagraph space
38.nr PD 0.33v
38.nr PD 0.33v
39.\" footnote width
39.\" footnote width
src/Text/Pandoc/Writers/Ms.hs+3−4
@@ -516,10 +516,9 @@ inlineToMs opts (Link _ txt (src, _)) = do
516 doubleQuotes (text (escapeUri src)) <> text " -A " <>
516 doubleQuotes (text (escapeUri src)) <> text " -A " <>
517 doubleQuotes (text "\\c") <> space <> text "\\") <> cr <>
517 doubleQuotes (text "\\c") <> space <> text "\\") <> cr <>
518 text " -- " <> doubleQuotes (nowrap contents) <> cr <> text "\\&"
518 text " -- " <> doubleQuotes (nowrap contents) <> cr <> text "\\&"
519−inlineToMs opts (Image attr alternate (source, tit)) = do
519+inlineToMs _ (Image _ alternate (_, _)) =
520− let alt = if null alternate then [Str "image"] else alternate
521− linkPart <- inlineToMs opts (Link attr alt (source, tit))
522− return $ char '[' <> text "IMAGE: " <> linkPart <> char ']'
520+ return $ char '[' <> text "IMAGE: " <>
521+ text (escapeString (stringify alternate)) <> char ']'
523inlineToMs _ (Note contents) = do
522inlineToMs _ (Note contents) = do
524 modify $ \st -> st{ stNotes = contents : stNotes st }
523 modify $ \st -> st{ stNotes = contents : stNotes st }
525 return $ text "\\**"
524 return $ text "\\**"
test/writer.ms+8−14
@@ -17,15 +17,15 @@
17.\" left margin
17.\" left margin
18.nr PO 1.25i
18.nr PO 1.25i
19.\" top margin
19.\" top margin
20−.nr HM 1.25in
20+.nr HM 1.25i
21.\" bottom margin
21.\" bottom margin
22−.nr FM 1.25in
22+.nr FM 1.25i
23.\" header/footer width
23.\" header/footer width
24.nr LT \n[LL]
24.nr LT \n[LL]
25−.\" point size (pt x 1000)
25+.\" point size
26−.nr PS 10000
26+.nr PS 10p
27−.\" line height (pt x 1000)
27+.\" line height
28−.nr VS 12000
28+.nr VS 12p
29.\" font family: A, BM, H, HN, N, P, T, ZCM
29.\" font family: A, BM, H, HN, N, P, T, ZCM
30.fam T
30.fam T
31.\" paragraph indent
31.\" paragraph indent
@@ -969,15 +969,9 @@ Images
969.LP
969.LP
970From \[lq]Voyage dans la Lune\[rq] by Georges Melies (1902):
970From \[lq]Voyage dans la Lune\[rq] by Georges Melies (1902):
971.PP
971.PP
972−[IMAGE: \c
972+[IMAGE: lalune]
973−.pdfhref W -D "lalune.jpg" -A "\c" \
974− -- "lalune"
975−\&]
976.PP
973.PP
977−Here is a movie [IMAGE: \c
974+Here is a movie [IMAGE: movie] icon.
978−.pdfhref W -D "movie.jpg" -A "\c" \
979− -- "movie"
980−\&] icon.
981.HLINE
975.HLINE
982.SH 1
976.SH 1
983Footnotes
977Footnotes