indent positioning in DOCX

D

David Thielen

Hi;

An indent is defined as:
<w:lvl w:ilvl="0" w:tplc="98F46508">
<w:start w:val="1"/>
<w:nfc w:val="23"/>
<w:lvlText w:val="ï‚·"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="list" w:pos="720"/>
</w:tabs>
<w:ind w:left="720" w:hanging="360"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Symbol" w:h-ansi="Symbol" w:hint="default"/>
</w:rPr>
</w:lvl>

A couple of questions on this:

1) How does the w:ind left/hanging & w:tabs work together? It looks like the
hanging attribute is the location of the bullet character and then the next
tab is where the text starts. And that subsequent lines are set by the left
attribute.

2) It looks like if the first tab is before the end of the bullet character,
the text starts at the following tab.

3) There appears to be no way to set a default tab stop in the
w:lvl/w:pPr/w:tabs - does it use the default of the paragraph, or does it use
0.5", or is there no default?

4) If w:tabs and/or w:ind is not set, does it then use those from the
paragraph? Or will those always be set?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jialiang Ge [MSFT]

Hello Dave,

Based on your word xml snippet, the rules are:
1. [The pos of bullet character] always == [w:left] - [w:hanging (w:ind)]
2. [The pos of the first non-bullet character] == [w:left] when [the pos of
bullet char] + [minimal width of the bullet char] < w:left;
If [the pos of bullet char] + [minimal width of the bullet char] >=
[w:left], [The pos of the first non-bullet character] == [the pos of bullet
char] + [minimal width of the bullet char]
3. [The pos of subsequent lines] always == [w:left]
4. The above rules are not influenced by any setting of w:tab. However, a
hanging indent specified via the hanging attribute on the ind element shall
always implicitly create a custom tab stop at its location.

Therefore, for your questions:
1) How does the w:ind left/hanging & w:tabs work together?
W:ind determines the paragraph's Indentation setting
(Word2007->Home->Paragraph->Indentation), while w:tab determines the tabs
stop positions in the paragraph (Word2007->Home->Paragraph->Tabs¡­). For
more details about w:ind and w:tab, see Office Open XML Spec. Part 4. Page
75 and Page 143. W:ind settings will not be influenced by w:tabs settings.
However, a hanging indent specified via the hanging attribute on the ind
element shall always implicitly create a custom tab stop at its location.

2) It looks like if the first tab is before the end of the bullet
character, the text starts at the following tab.
See the rule 2 above. If [the pos of bullet char] + [minimal width of the
bullet char] >= [w:left], [The pos of the first non-bullet character] ==
[the pos of bullet char] + [minimal width of the bullet char]

3) There appears to be no way to set a default tab stop in the
w:lvl/w:pPr/w:tabs
There is almost no custom tab stop position if we do not specify any w:tab
element in w:tabs. (However, a hanging indent specified via the hanging
attribute on the ind element shall always implicitly create a custom tab
stop at its location.) The default tab stops is 2 ch, which you can find in
Word2007->Home->Paragraph->Tabs¡­->Default Tab Stops.

4) If w:tabs and/or w:ind is not set, its value is determined by the
setting previously set at any level of the style hierarchy (i.e. that
previous setting remains unchanged). If the setting is never specified in
the style hierarchy, then no indentation of that type or custom tab stops
shall be used for this paragraph.

If you have any other concerns or questions, feel free to let me know.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi;

It does not seem to be working that way. From playing around with it it
appears that:
1) w:p/w:pPr/w:ind sets the position of the bullet and left margin for lines
1+
2) The text for line 0 starts at w:/listDef/w:lvl/w:pPr/w:tabs/w:tab
3) w:/listDef/w:lvl/w:pPr/w:ind is ignored and does nothing

Please take a look at http://www.windwardreports.com/temp/lists.zip to see.

I think the way it works is:
1a) If there is a w:p/w:pPr/w:ind that sets the bullet and left margin
1b) If there is no w:p/w:pPr/w:ind then w:/listDef/w:lvl/w:pPr/w:ind sets
the bullet and left margin
2a) If there is a w:/listDef/w:lvl/w:pPr/w:tabs/w:tab - it is sometimes
used. It appears that the tab must be at least 360 twips after the bullet to
be used.
2b) If there is no w:/listDef/w:lvl/w:pPr/w:tabs/w:tab or the value is too
low, then line 0 is at the same place as line 1+
3) w:p/w:pPr/w:tabs/w:tab is never used.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jialiang Ge [MSFT]

Yes, I see. It was my mistake in the last reply. Sorry.

I have sent the question to the Office developers, and ask for their
clarification and confirmation. I will be back to you as soon as possible.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
J

Jialiang Ge [MSFT]

Hello Dave,

Sorry for my delayed response. The Office team confirms the rules as follows
(Because the rules are organized in hierarchy which cannot be easily shown
with plain text in Newsgroup system, I have sent a copy to your mailbox)

1 First, to get the final state of any property (including indents), we
need to follow the style hierarchy rules in ¡ì2.7.2 of the specification
1.1 There, it correctly states that the direct formatting (the pPr under
the p element) supersedes the version in the list definition
1.2 Since tab stops are additive, we just gather them all up and we have
the full set of tab stops
2. Now, we display the list as follows:
2.1First, check the numFmt element ¡ì2.9.18 to see the format of any
numbers in the list definition.
2.2 Next, place the text in the lvlText element ¡ì2.9.12 at the location
of the final left indent.
2.2.1 If the numFmt isn't "bullet", we need to replace the %[1-9] syntax
appropriately.
2.3 Now, look at the suff element ¡ì2.9.30 to see what separates the
bullet from the text.
2.3.1 If it's space or nothing, add a space or nothing.
2.3.2 If it's tab, add a tab.
2.3.2.1Then we just need to know what the next tab stop is.
2.3.2.2 For that, any tab stop after the end of the displayed level
text is valid:
2.3.2.2.1 Tabs set with the tab element
2.3.2.2.2 Any hanging indent (as long as the
doNotUseIndentAsNumberingTabStop element ¡ì2.15.3.2 is not set)
2.3.2.2.3 Default tab stops at the distances set by the
defaultTabStop element ¡ì2.15.1.24
3. Finally, we justify the result - from start of the level text to end of
the line. You justify now so that it's always relative to the same tab
stops.

On your points, 1a and 1b are correct, but 2a and 3 are not - the first
available tab stop using the logic above is used. For example, if you look
at this attachment, I added a tab stop to the paragraph properties and now
Word's using that.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
D

David Thielen

This matches all of our tests - thank you very much!

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Jialiang Ge said:
Hello Dave,

Sorry for my delayed response. The Office team confirms the rules as follows
(Because the rules are organized in hierarchy which cannot be easily shown
with plain text in Newsgroup system, I have sent a copy to your mailbox)

1 First, to get the final state of any property (including indents), we
need to follow the style hierarchy rules in ¡ì2.7.2 of the specification
1.1 There, it correctly states that the direct formatting (the pPr under
the p element) supersedes the version in the list definition
1.2 Since tab stops are additive, we just gather them all up and we have
the full set of tab stops
2. Now, we display the list as follows:
2.1First, check the numFmt element ¡ì2.9.18 to see the format of any
numbers in the list definition.
2.2 Next, place the text in the lvlText element ¡ì2.9.12 at the location
of the final left indent.
2.2.1 If the numFmt isn't "bullet", we need to replace the %[1-9] syntax
appropriately.
2.3 Now, look at the suff element ¡ì2.9.30 to see what separates the
bullet from the text.
2.3.1 If it's space or nothing, add a space or nothing.
2.3.2 If it's tab, add a tab.
2.3.2.1Then we just need to know what the next tab stop is.
2.3.2.2 For that, any tab stop after the end of the displayed level
text is valid:
2.3.2.2.1 Tabs set with the tab element
2.3.2.2.2 Any hanging indent (as long as the
doNotUseIndentAsNumberingTabStop element ¡ì2.15.3.2 is not set)
2.3.2.2.3 Default tab stops at the distances set by the
defaultTabStop element ¡ì2.15.1.24
3. Finally, we justify the result - from start of the level text to end of
the line. You justify now so that it's always relative to the same tab
stops.

On your points, 1a and 1b are correct, but 2a and 3 are not - the first
available tab stop using the logic above is used. For example, if you look
at this attachment, I added a tab stop to the paragraph properties and now
Word's using that.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
J

Jialiang Ge [MSFT]

You are welcome! :)

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top