aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-02 10:11:32 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-02 10:11:32 -0700
commitf82d574d14c9ad71e76b8dfcbadac89ab4d10501 (patch)
tree906070ed68e00738866f43aed639dedc858f4501 /src/Text/Pandoc/Writers
parent9e58730a74bb0bf4a430cb3384dfe569c2bf3340 (diff)
downloadpandoc-f82d574d14c9ad71e76b8dfcbadac89ab4d10501.tar.gz
OpenDocument writer: improve bullet/numbering alignment.
This patch eliminates the large gap we used to have between bullet and text, and also ensures that numbers in numbered lists will be right-aligned. Closes #4385.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index 6f6f58ae6..cb29e390a 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -563,10 +563,18 @@ orderedListLevelStyle (s,n, d) (l,ls) =
listLevelStyle :: Int -> Doc
listLevelStyle i =
- let indent = show (0.4 * fromIntegral (i - 1) :: Double) in
- selfClosingTag "style:list-level-properties"
- [ ("text:space-before" , indent ++ "in")
- , ("text:min-label-width", "0.4in")]
+ let indent = show (0.5 * fromIntegral i :: Double) in
+ inTags True "style:list-level-properties"
+ [ ("text:list-level-position-and-space-mode",
+ "label-alignment")
+ , ("fo:text-align", "right")
+ ] $
+ selfClosingTag "style:list-level-label-alignment"
+ [ ("text:label-followed-by", "listtab")
+ , ("text:list-tab-stop-position", indent ++ "in")
+ , ("fo:text-indent", "-0.1in")
+ , ("fo:margin-left", indent ++ "in")
+ ]
tableStyle :: Int -> [(Char,Double)] -> Doc
tableStyle num wcs =