Latent Styles
Styles
This page can be read by itself, but it was written as the second in a series on Styles. The first article, providing a rough
overview of the Styles user interface in Word 2013 can be found herehere [link to the first page in this series at StylesPane.php]
Although probably still controversial, the Office Open XML format has been with us for several years now, and it is not likely to go away in a hurry. One positive impact, from my point of view, is that it has made it much easier than before to delve into documents and actually see what is happening. More importantly, in some ways, as a published standard, it provides something that has been missing from Word for years: documentation. Various versions of the standard are available from Ecma International – European Association for Standardizing Information and Communication Systems (ECMA) and the International Organization for Standardization (ISO); for this discussion I am using the 3rd edition of the ISO version, published in 2012.
If I were being kind I would say Word was trying to help you, but the reality is that Word tries rather too hard, and tends to impose rather than help. If you don’t have your own styles defined, Word has a set of built‑in defaults that it will present to you, and it will store these in your Normal Template, when it creates it. Depending on the version of Word you are using it may have several hundred styles and storing them all might create quite some additional overhead.
To minimise the overhead of storing many unused styles in all their glory, the standard provides a mechanism for specifying a set of generic properties, using the concept of “Latent Styles”. According to the standard:.
Latent styles refer to any set of style definitions known to an application which have not been included in the current document.
When a style definition is embedded in a document, it specifies two distinct groups of properties:
Obviously, embedding all the styles known to a particular application in each document which it produces would drastically increase the file size. Latent styles provide a way to store pieces of information for the first group (behavior properties) which shall be specified for all styles known to an application without requiring the storage of the second group (formatting properties).
It goes on the give an example that I see no need to reproduce here.
Latent styles are not, inherently, anything to do with document content. Everything to do with them is about the way Word behaves, and they provide a mechanism for documents to contain rules to control Word’s behaviour. Although not, of itself, an unreasonable one, the concept of ‘known to the application’ (i.e. built‑in) styles is essentially a Word one.
The behaviour properties that can be specified are:
Default Style Locking. The nature of having application-specified, rather than user specified, styles means that individual users are free, are encouraged, to use any styles the application chooses to offer them: control seems to rest with the application rather than the template designer, say, or the document owner.
Style locking can be applied through the user interface and, when it saves a document, Word will set the default to whichever setting (locked or not) is applied to a majority of styles, and will apply overrides to any other styles that it chooses to provide that have the other setting. When creating, or amending, a document by editing the XML, it makes sense to set the default to ‘locked’ but, for the most part, this value can be considered informative rather than useful; at best this attribute is an optimisation aid.
Setting this default to “1” (meaning true, or locked) does not apply any protection; it merely specifies that styles will be locked by default if protection is applied. The protection, itself, must be separately applied elsewhere, and is best done through the user interface. As noted elsewhere, however, the protection is wholly ineffective.
Default Primary Style. A style can be declared as ‘primary’ using, I kid you not, the qFormat element. According to the definition, specifying this means that a ‘style has been designated as being particularly important for the current document’, and ‘this information can be used by an application in any means desired’.
The standard, although nominally an industry standard, started life as a reflection of the way Word stored documents, and the way Word worked. Terminology is difficult at the best of times and I can only imagine that attempts to generalise this definition led to the apparent incongruity here. As far as I know, the term primary style was not previously used in Word, but I'm guessing that qFormat was used internally, the “q” indicating the “quick” in Quick Styles, which Word did, at one time, call the styles in the Ribbon.
It seems remarkable to me that a style known only to the application, and not otherwise known to a document, could possibly be considered as being important to a document, and I am at a loss to explain the concept involved in this being an option for which a default attribute exists. But what do I know?
Default User Interface Priority Setting. Styles are each given a priority, on which lists of them can be sorted. Word calls this sorting in ‘recommended order’. This attribute allows for specifying a default for the priority of latent styles and, thus, the order in which they are sorted relative to other styles.
According to the standard, if this is not specified, the default shall be 99. You may remember from my overview of the styles UI that priorities could have values from 1 to 99, or “last”. Last is equivalent to 100 and, although I didn't mention it, is shown as 100 in some parts of the UI. You might wonder why the default should be 99, rather than last. The reason is that priorities in the UI are shown as being one greater than the value stored in the XML, at least those in the range 0 to 99 are — those outside this range (and any whole number, positive or negative, can be specified) all seem to be interpreted as zero, and shown in the UI as having priority 1.
Default Semi‑Hidden Setting. Styles can be hidden or semi‑hidden. Being hidden means, in theory, that a style is not available from ‘any and all user interfaces’, whilst being semi‑hidden means it is not available from what the specification calls the main UI.
The idea of having latent styles completely hidden by default would rather defeat the purpose of having them; equally, drowning the user in a sea of weird and wonderful styles, although Word does incline in that direction, would be counter‑productive. That leaves semi‑hidden, something of a half way house, the logical choice to be applied to latent styles, and this the natural default.
Default Hidden Until Used Setting. Determined users can find styles that are semi‑hidden and use them. The unhideWhenUsed setting determines whether or not these styles will remain semi‑hidden when they have been used. It seems reasonable that, once used, styles should be available; the user who has had to battle through layers of obscurity to find a style once is not going to be best pleased to have to repeat the process, so, by default, Word uses this mechanism on most built‑in styles.
There is one further attribute provided for in the standard, one that can not really be described as a behavior property at all, and that is a count. According to the standard, this “specifies the number of known styles which shall be initialized to the current latent style defaults when this document is first processed”. This is an instruction to the application about how it should present styles that are not defined in the document it is processing. The user has no knowledge of this setting, and no control over it, not in Word, anyway, and even if set by a different application, or by manipulating the XML, Word will change it without warning, or any reference to the user.
It is hard to know where to begin writing about what is wrong with this! For example, imagine an application that ‘knows about’ 200 styles, and then imagine that this count is set to 50. Which fifty styles should be set to the defaults, and what should the others be set to? Should an application always choose the same fifty? What about a different application that ‘knows about’ a different set of styles? I could, go on but I hope you get the picture.
The standard goes on to note that “this can be used by an application as needed to ensure that only the number of styles known when a document was created are initialised with the default settings”. Whilst I don’t really see how an application can actually ensure such a thing through the use of this setting, I don’t really see, either, how this is beneficial for the user of the document. A set of defaults for styles not known to the document should, one would think, apply to all of them, not an arbitrary number of them.
This setting provides a mechanism for new versions of Word to liberally spray your document with new styles after you have spent time and effort carefully ensuring that users of your document see only what you want them to see. It is evil, but I have written enough! You have no effective control over this, so just be aware of it.
Word 2007 claims 267 latent styles, and defaults them to unlocked, priority 99, semi‑hidden, unhide when used, and non‑primary. It lists 137 overrides:
Table Styles, 99 of them. These are all set not semi‑hidden, and, rather pointlessly, not to be unhidden when used. They all have priorities in the 60s and 70s.
TOC styles 1 through 9 are given a priority of 39, as is the TOC Heading, which is also denoted as primary.
Headings 1 through 9, priority 9. Heading 1 is not semi‑hidden, the others as per default.
Normal and No Spacing, priorities 0 and 1 respectively, not semi‑hidden, and not to be unhidden. Also Default Paragraph Font at priority 1 remaining semi‑hidden, to be unhidden when used.
A batch of styles denoted as primary and not hidden: Caption, Title, Subtitle, Strong and Emphasis, Subtle Emphasis and Intense Emphasis, Quote, Intense Quote, Subtle Reference, Intense Reference, and Book Title. These primary styles are the ones that Word includes in the gallery in the Ribbon.
List Paragraph, also deemed important and to be seen.
Finally, Placeholder Text and Revision, not to be unhidden, and Bibliography.
I don't have Word 2010 in front of me as I write but I believe it hosts the same styles as Word 2007. In Word 2013, however, there are over a hundred new styles.