From 7a4f87b992d996926ca2c58d768ce15fa712f1ab Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 Sep 2013 11:22:34 +0530 Subject: [PATCH] DOCX Input: Specify zero default margins for headings DOCX Input: Fix extra top/bottom margins around headings when the heading style in word does not specify any top/bottom margins. --- src/calibre/ebooks/docx/styles.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/styles.py b/src/calibre/ebooks/docx/styles.py index 4572eb59f2..1201f696c2 100644 --- a/src/calibre/ebooks/docx/styles.py +++ b/src/calibre/ebooks/docx/styles.py @@ -437,7 +437,8 @@ class Styles(object): '''\ body { font-family: %s; font-size: %s; color: %s } - ul, ol, p { margin: 0; padding: 0 } + /* In word all paragraphs have zero margins unless explicitly specified in a style */ + ul, ol, p, h1, h2, h3, h4, h5, h6 { margin: 0; padding: 0 } sup.noteref a { text-decoration: none }