none
Why no spacing before the paragraph RRS feed

Answers

  • Hi Dave,

    Thanks for your patience on this. After a bit of digging around, I discovered that this behaviour used to be configurable via a setting (in Word pre-2013). This was a compatibility setting that suppressed "before" spacing after hard page breaks (believe it or not!). There is a more detailed discussion about this here:

    http://wordribbon.tips.net/T008254_Eliminating_Before_Spacing_at_the_Top_of_a_Page.html

    The compatibility setting is called suppressSpBfAfterPgBrk and is boolean. So the idea would be that you set this to false in the settings.xml part, like this:

    ...
        <w:compat>
            <w:useFELayout/>
            <w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/>
            <w:compatSetting w:name="overrideTableStyleFontSizeAndJustification" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
            <w:compatSetting w:name="enableOpenTypeFeatures" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
            <w:compatSetting w:name="doNotFlipMirrorIndents" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
            <w:compatSetting w:name="differentiateMultirowTableHeaders" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
            <w:suppressSpBfAfterPgBrk w:val="false"/>
        </w:compat>
    ...

    (the previous excerpt taken from my test document)

    The pertinent line being:

    <w:suppressSpBfAfterPgBrk w:val="false"/>

    However, this doesn't have any apparent effect. I need to do some more digging on this setting but for purposes of implementation, Word 2013 is not going to render "before" spacing after a hard page break. I think that explains the behaviour.

    Let me know if this is not clear.

    Best regards,
    Tom Jebo
    Microsoft Open Specifications
     

    Wednesday, December 10, 2014 8:56 AM
    Moderator
  • Hi Dave,

    I know it's been a while but I wanted to follow up with an explanation of the section break before spacing issue. After discussing internally, it looks like this is not a bug but a side effect of how Word manages space.

    Word aims to provide intra-paragraph spacing that is the maximum of the before (of the current para) and after (of the previous para) spacing values.  When the page is broken due to a section break, the space between the top of the page and the first para on the page is given the balance of what the last para on the previous page didn’t use for its after value. In the following pictures, hopefully this effect can be seen more clearly.

    In each of these screen shots, I’ve highlighted (by selection) the two para’s that straddle a section break. I’ve also identified the spacing values for before and after. Also, in each case, 48 was the maximum of the before and after. Therefore, the total gap is about 2/3 of an inch.

    In this first shot, you see that before is 48 and after is 0. The section break itself appears to play the role of another para. In this case, the “previous” para uses 0 of the 48 pt balance and therefore, the para on the next page can use all of it.

    48 before, 0 after

    In the next shot you can see that after has been increased to 8, causing the effective before to be 40 in the rendering.

    48 before, 8 after

    (continued in next post)...

    Wednesday, March 25, 2015 5:12 AM
    Moderator
  • (contined from previous post)...

    Finally, in this shot you see that before and after are both 48.  Since the previous para uses all 48, the para on the next page uses none.

    48 before, 48 after

    I hope this has helped to explain the behavior you are seeing.

    Thanks,

    Tom

    Wednesday, March 25, 2015 5:13 AM
    Moderator

All replies

  • Hi Dave,

    Thank you for your question. A member of the Protocol Documentation support team will respond to you soon. Please check the link, I got Page Not Found 

    Regards,
    Vilmos Foltenyi - MSFT


    • Edited by Vilmos Foltenyi Wednesday, November 26, 2014 11:38 PM link in the original posting is broken
    Wednesday, November 26, 2014 11:27 PM
  • Hey Dave,

    I'll look into this. I created a simple document and reproduced the issue. See if this matches your steps and then you don't need to upload anything:

    1. blank document in Word
    2. type "=rand()" to generate randome paragraphs
    3. right click and select paragraph properties on the first paragraph
    4. Indents and Spacing | Spacing | Before: <change this from 0 to 12pt>, then <OK>
    5. set the cursor after the last character on the page and <Alt>-N-B to insert a page break
    6. repeat steps 2-4

    I did notice that no spacing was added on the second page but spacing was added on the first page.

    I'm going to dig into this over the weekend.

    Best regards,
    Tom Jebo
    Microsoft Open Specifications

    Thursday, November 27, 2014 11:03 PM
    Moderator
  • Bingo - yes. And my link above (which somehow got the msdn url prepended to it) is http://simba.windward.net/temp/Bug_17520.docx

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Friday, November 28, 2014 12:20 PM
  • Hi Dave,

    Thanks for your patience on this. After a bit of digging around, I discovered that this behaviour used to be configurable via a setting (in Word pre-2013). This was a compatibility setting that suppressed "before" spacing after hard page breaks (believe it or not!). There is a more detailed discussion about this here:

    http://wordribbon.tips.net/T008254_Eliminating_Before_Spacing_at_the_Top_of_a_Page.html

    The compatibility setting is called suppressSpBfAfterPgBrk and is boolean. So the idea would be that you set this to false in the settings.xml part, like this:

    ...
        <w:compat>
            <w:useFELayout/>
            <w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/>
            <w:compatSetting w:name="overrideTableStyleFontSizeAndJustification" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
            <w:compatSetting w:name="enableOpenTypeFeatures" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
            <w:compatSetting w:name="doNotFlipMirrorIndents" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
            <w:compatSetting w:name="differentiateMultirowTableHeaders" w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
            <w:suppressSpBfAfterPgBrk w:val="false"/>
        </w:compat>
    ...

    (the previous excerpt taken from my test document)

    The pertinent line being:

    <w:suppressSpBfAfterPgBrk w:val="false"/>

    However, this doesn't have any apparent effect. I need to do some more digging on this setting but for purposes of implementation, Word 2013 is not going to render "before" spacing after a hard page break. I think that explains the behaviour.

    Let me know if this is not clear.

    Best regards,
    Tom Jebo
    Microsoft Open Specifications
     

    Wednesday, December 10, 2014 8:56 AM
    Moderator
  • That's impressive detective work - thank you

    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Wednesday, December 10, 2014 12:15 PM
  • Hi Tom;

    A couple of issues we found. First off, Word 2013 does not show those options.

    Second, it looks like soft page breaks do not add the spacing.

    Third, section breaks add spacing before, but only about half of what is set.

    Can you confirm that with Word 2013 it's now set to to the mode of not adding the spacing for soft page breaks and find out what is added for section breaks?

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Tuesday, December 16, 2014 12:43 AM
  • Hi Dave,

    I'm aware of the fact that the UI no longer offers the compatibility settings; this was discussed in the wordribbon thread I referred to. That is a product UI issue.

    As far as the behavior when using page breaks, yes, it is not using the compatibility mode of adding spacing after page breaks by default. I think this was also discussed.

    As far as, getting the suppressSpBfAfterPgBrk compatibility setting to have an effect on Word 2013, I still need to find out if this is a bug or "user error" on my part. I suspect that we just aren't respecting that setting.  I just haven't had time to dig into that one yet. I will let you know what I find.

    The amount of spacing added by the section breaks: I think I did see a difference when I was testing but was focused on page breaks. 

    Ok, so I see two issues that I need to look into:

    1. suppressSpBfAfterPgBrk transitional compatibility element not working in Word 2013

    2. section breaks add less than the full "before" spacing quantity in Word 2013.

    Correct?

    Tom

    Tuesday, December 16, 2014 1:44 AM
    Moderator
  • As for #1, I found that the compatibility settings do indeed work, but to get them to work, you have to save the file as a .doc then resave it as a .docx with compatibility settings:

    This blog by Cindy Meister talks about how to get the compatibility settings to show up again:
    http://blogs.msmvps.com/wordmeister/2013/02/04/word-2013-the-layout-options/

    I tested this and it works:

    1. save the .docx as a .doc
    2. set the compatibility setting you want; i.e. suppress before spacing after a hard page break
    3. save the file as a .docx again, selecting the "Maintain compatibility with previous versions of Word" check box.

    If you do this, you'll see a settings section like this one:

        <w:compat>
            <w:suppressTopSpacing/>
            <w:suppressSpBfAfterPgBrk/>
            <w:useFELayout/>
            <w:useNormalStyleForList/>
            <w:doNotUseIndentAsNumberingTabStop/>
            <w:useAltKinsokuLineBreakRules/>
            <w:allowSpaceOfSameStyleInTable/>
            <w:doNotSuppressIndentation/>
            <w:doNotAutofitConstrainedTables/>
            <w:autofitToFirstFixedWidthCell/>
            <w:displayHangulFixedWidth/>
            <w:splitPgBreakAndParaMark/>
            <w:doNotVertAlignCellWithSp/>
            <w:doNotBreakConstrainedForcedTable/>
            <w:doNotVertAlignInTxbx/>
            <w:useAnsiKerningPairs/>
            <w:cachedColBalance/>
            <w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="11"/>
        </w:compat>

    And the settings appear to work.

    Without compatibility mode, the behaviour is locked in to suppressing the "before" spacing after a hard page break.

    On to #2...

    Tom

    Sunday, December 21, 2014 11:45 PM
    Moderator
  • Thank you. Also, glad to see Word is removing most of the compatibility items - it's a lot cleaner to say this is what it does.

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Monday, December 22, 2014 3:37 PM
  • Hi Dave,

    The second issue about section breaks to a new page not showing the full "before" spacing; this was much harder to try to nail down and honestly, I haven't. After much testing, it appears that Word 2013 does this in both compatibility mode and .docx mode. I went through all the compatibility settings but nothing affects this. It looks to me like some kind of bug in calculation or something. The best I can do at this point is gather all the data and pass it up to the Word team to see if they can identify and fix it. I'll let you know if they reveal any more insight but I think this is as far as I can go for now.

    Thanks,

    Tom


    Tuesday, January 6, 2015 8:39 PM
    Moderator
  • Ok, I'll cross my fingers that they give you an answer.

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Wednesday, January 7, 2015 12:09 AM
  • Hi Dave,

    I know it's been a while but I wanted to follow up with an explanation of the section break before spacing issue. After discussing internally, it looks like this is not a bug but a side effect of how Word manages space.

    Word aims to provide intra-paragraph spacing that is the maximum of the before (of the current para) and after (of the previous para) spacing values.  When the page is broken due to a section break, the space between the top of the page and the first para on the page is given the balance of what the last para on the previous page didn’t use for its after value. In the following pictures, hopefully this effect can be seen more clearly.

    In each of these screen shots, I’ve highlighted (by selection) the two para’s that straddle a section break. I’ve also identified the spacing values for before and after. Also, in each case, 48 was the maximum of the before and after. Therefore, the total gap is about 2/3 of an inch.

    In this first shot, you see that before is 48 and after is 0. The section break itself appears to play the role of another para. In this case, the “previous” para uses 0 of the 48 pt balance and therefore, the para on the next page can use all of it.

    48 before, 0 after

    In the next shot you can see that after has been increased to 8, causing the effective before to be 40 in the rendering.

    48 before, 8 after

    (continued in next post)...

    Wednesday, March 25, 2015 5:12 AM
    Moderator
  • (contined from previous post)...

    Finally, in this shot you see that before and after are both 48.  Since the previous para uses all 48, the para on the next page uses none.

    48 before, 48 after

    I hope this has helped to explain the behavior you are seeing.

    Thanks,

    Tom

    Wednesday, March 25, 2015 5:13 AM
    Moderator
  • Ok, that makes a lot of sense. 

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Wednesday, March 25, 2015 8:55 PM