none
DOCX - why does line spacing affect paragraph spacing

Answers

All replies

  • Hi, DavidThi808,

      Thanks for your question.  We will look at it and respond to you soon.

     

     


    Hongwei Sun -MSFT
    Tuesday, April 26, 2011 6:59 PM
  • Dave,

    I am the engineer who has taken ownership of your issue and am currently investigating this matter.

    I will update you as things progress.

    Wednesday, April 27, 2011 2:51 PM
  • thank you (hopefully I won't wear out my welcome with all these questions).
    Very funny video - What's your Metaphor?
    Wednesday, April 27, 2011 3:16 PM
  • Dave,

     

    Line spacing determines the amount of vertical space between each line inside of a paragraph.

    Paragraph spacing determines the amount of space above or below a paragraph.

     

    However, also note Section 17.3.1.33 entitled spacing (Spacing Between Lines and  Above/Below Paragraph) in both ECMA-376 Section Edition and ISO-29500.

    We state the following information:

     

    When determining the spacing between any two paragraphs, a consumer shall use the maximum of the inter-

    line spacing in each paragraph, the spacing after the first paragraph and the spacing before the second

    paragraph to determine the net spacing between the paragraphs.

     

    [Example: Consider two consecutive single-spaced paragraphs in a document, the first of which specifies spacing

    below of 12 points, the second of which specifies spacing above of 4 points. These constraints are expressed

    using the following WordprocessingML:

     

    <w:p>

      <w:pPr>

        <w:spacing w:after="240" /> 

      </w:pPr>

      …

    </w:p>

    <w:p>

      <w:pPr>

        <w:spacing w:before="80" /> 

      </w:pPr>

      …

    </w:p>

     

    The resulting spacing between the first and second paragraph is 12 points, since that is the largest spacing

    requested between the two paragraphs. end example]

     

    Note that the values presented are in twentieths of a point.

     

    • Proposed as answer by King Salemno Wednesday, April 27, 2011 8:32 PM
    • Marked as answer by DavidThi808 Thursday, April 28, 2011 5:02 AM
    • Unmarked as answer by DavidThi808 Thursday, April 28, 2011 1:31 PM
    • Unproposed as answer by DavidThi808 Thursday, April 28, 2011 5:30 PM
    Wednesday, April 27, 2011 8:32 PM
  • Hi;

    I would swear I read that section and did not see that. But apparently I missed it. (My wife claims I can never find anything so...)

    thanks - dave


    Very funny video - What's your Metaphor?
    Thursday, April 28, 2011 5:03 AM
  • Hi;

    Please take a look at http://www.windwardreports.com/temp/spacing.docx - the spacing between Tanya and Brianna matches what you said where the inter-line spacing is applied after (but not before) the paragraphs.

    But the spacing around Shirley does not match - it puts the 1" spacing before, and a much smaller spacing after. Why?

    thanks - dave


    Very funny video - What's your Metaphor?
    Thursday, April 28, 2011 1:33 PM
  • Hi;

    One more thing I want to confirm. It looks like the interline spacing includes the line itself while the before/after does not. So an interline spacing of 0 would put lines on top of each other while a before/after of 0 is basically single spacing.

    So. Does that mean when the interline spacing is used for the between paragraph spacing, we only use the value of it that is greater than single line spacing? And is it only that difference compared with the para after spacing, or is it the full value compared with the after where we determine which to use?

    In other words, if w:line='240' and w:after='40', that is single line spacing for w:line and it would put the next line right after it. w:after is saying add 2 points after so it would cause a greater spacing, but it's value is less. So which is used?

    thanks - dave


    Very funny video - What's your Metaphor?
    Thursday, April 28, 2011 2:54 PM
  • Dave,

    I am reviewing the behavior exhibited in Word. I can tell you at this point that the behavior described in the standard does not match the behavior observed, and we do not have a behavior note in our supplemental documents.

    I am still reviewing this and hope to have an answer for you soon.

    Monday, May 02, 2011 1:36 AM
  • Ow - not what one wants to hear. Thank you for diving in to this (and all the other weird cases I find).

    thanks - dave


    Very funny video - What's your Metaphor?
    Monday, May 02, 2011 2:17 PM
  • Dave,

    Nothing new to report yet, I am still investigating this matter.

    Thursday, May 05, 2011 11:52 AM
  • Dave,
     
    This information is pertinent to our layout algorithm and thus is implementation specific.
    Therefore, the information requested is considered out-of-scope of the documentation.
    • Proposed as answer by King Salemno Monday, May 09, 2011 2:42 PM
    • Unproposed as answer by DavidThi808 Monday, May 09, 2011 2:51 PM
    Monday, May 09, 2011 2:42 PM
  • Hi King;

    When something is not defined in DOCX and you say it is implementation specific, I may disagree with you about that counting as implementation specific - but I will agree that you have a logical argument in your answer.

    But when Word operates in direct contradiction to the spec, then I don't think you can call that implementation specific unless your argument is that the DOCX spec is a guide but Office will directly not follow it in places.

    In which case all of Microsoft's statements about this being a standard they are following are incorrect. So can you at least clarify if Office is supposed to fully and completely follow the OpenXML spec?

    thanks - dave


    Very funny video - What's your Metaphor?
    Monday, May 09, 2011 2:54 PM
  • David,

     

    Microsoft is unambiguously committed to Open XML.  It has increasingly implemented XML-based formats in successive releases of Office. The default file formats of Word, Excel, and PowerPoint are now based on Open XML.  To enable broad adoption of the formats, Microsoft has made irrevocable, royalty-free patent commitments to all developers who implement the formats.

     

    We are happy to see the growing number of implementers of the Open XML formats.  Our Implementer Notes for Open XML are intended to provide transparency into the choices we made in our own implementation of the formats to foster interoperability between our and other implementations.  We have received a lot of positive feedback about these notes and feel like they are serving their intended purpose.  But of course we understand that nothing is perfect and we are open to improving these notes over time.

     

    Where the standard makes normative statements about how an implementer must implement a specific section of the standard, we identify any deviations.  Thankfully, you’ve identified an area where the notes need improvement –we have inadvertently failed to identify our deviation from Section 17.3.1.33.  We regret that and will make the following modification to the Notes:

     

    The standard states that when the line height is “exactly” and is larger than required, the text is centered in the available space. When line height is “exactly” or “at-least” and is larger than required, Word positions the text at the bottom of the line.

     

    We think that Implementer Notes are very valuable and encourage all implementers to publish them.  No implementation of a format is exactly the same as others, so transparency as to the choices that are made that affect interoperability are good for the entire community.  We look forward to working with you and others towards this goal.  To be clear – no one is asking for the publication of feature or implementation-specific information that might differentiate one product from another that would chill innovation.  Instead, we and others are looking for interoperability-related information that will benefit customers.


    • Marked as answer by King Salemno Wednesday, July 06, 2011 12:46 PM
    • Unmarked as answer by DavidThi808 Wednesday, July 06, 2011 12:54 PM
    Thursday, May 26, 2011 8:15 PM
  • Hi;

    Thank you and I agree on the implementer notes. (By definition our implementer notes are Word's because we need to match Word 100%.)

    I have a couple of questions as to your clarification. You first condition is "exactly and larger than required" and the second is "exactly or at-least and larger than required." Isn't the first condition always a subset of the second condition? Or am I missing something.

    Second, the example http://www.windwardreports.com/temp/spacing.docx has a spacing of exactly 1 inch. It appears that it has added 1" of spacing 3/4 before the text and 1/4 after. So that is not centered or at the bottom of the line. Or does bottom of the line mean something different than I think?

    thanks - dave


    The future of B.I. - Raw & Uncut
    Friday, May 27, 2011 2:29 PM
  • King;

    I unmarked your comment as the answer (which you marked) because what you wrote is incorrect. See my reply to your comment that discusses how what you wrote is not what Word is doing.

    Any chance of finding out what Word is actually doing for paragraph spacing? That's sort-of fundamental to text layout.

    thanks - dave


    The future of B.I. - Raw & Uncut
    Wednesday, July 06, 2011 12:55 PM
  • Dave,

    This information is pertinent to our layout algorithm and thus is implementation specific.
    Therefore, the information requested is considered out-of-scope of the documentation.
    Wednesday, July 06, 2011 6:35 PM
  • Alex;

    I unmarked your reply as the answer because it does not answer the question, it merely explains why Microsoft is not going to document why they directly violate the DOCX spec in this case.

    I want to leave it open in case a non-Microsoft person figures out what Word is doing in this case and will then post an answer.

    thanks - dave


    The Programming Olympics - Code Wars
    Saturday, December 03, 2011 7:29 PM