Skip to content

Commit

Permalink
OpenDocument writer: improve bullet/numbering alignment.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jgm committed Oct 2, 2018
1 parent 9e58730 commit f82d574
Show file tree
Hide file tree
Showing 2 changed files with 579 additions and 193 deletions.
16 changes: 12 additions & 4 deletions src/Text/Pandoc/Writers/OpenDocument.hs
Expand Up @@ -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 =
Expand Down

0 comments on commit f82d574

Please sign in to comment.