Latent Styles

Styles

Latent Styles

Introduction

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.

Style Definitions

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:

  • Behavior properties
  • Formatting 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:

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’s Defaults

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:

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.