Pages 2: Trailing space causes ‘Following Paragraph Style’ option to fail

Posted by Pierre Igot in: Microsoft, Pages
March 14th, 2006 • 4:20 pm

I have finally elucidated a problem that had been bugging me for a long time.

Microsoft Word has always (for as long as I have been using it, anyway) suffered from a bug with paragraph styles that sometimes causes the “Style for following paragraph” option to fail.

In other words, if you have a paragraph style in a Word document whose definition specifies that the style for the following paragraph (i.e. after you press Return) should be another style, then normally when you press Return at the end of a paragraph in that style, Word inserts a paragraph mark and then switches to the other style specified in the definition.

This is convenient for heading styles. In your style definition for your heading style, you specify that the next paragraph should be in your normal body style. When you then apply the heading style to the current paragraph and press Return at the end of the paragraph, Word automatically changes to the body style for the next paragraph.

At least that’s what is supposed to happen. But sometimes in Word it simply fails to work and Word stays in the heading style for the following paragraph, in spite of what the style definition says. It’s a bug that’s been around forever.

When I first started using Apple’s Pages, I was hoping that such bugs wouldn’t affect a brand new processor with no impenetrable legacy code. Much to my surprise and disappointment, I soon discovered that it too appeared to suffer from the same bug, i.e. it would sometimes fail to switch styles after a Return character even though the style definition for the current style did specify a different style for the next paragraph. (In Pages, this is achieved with the “Following Paragraph Style” option in the “More” tab of the text inspector.)

It would happen from time to time, with various styles, including both built-in styles and styles that I had defined myself. I couldn’t figure out what would trigger the problem.

Needless to say, I filed a bug report, and got an answer from Apple saying that they couldn’t reproduce the problem…

Then today I finally discovered the reason for it: It happens if you have a trailing space at the end of the paragraph after the insertion point. For example, if you have a heading style whose definition specifies that the next paragraph should be in body style, and if you are in the following situation, with a trailing space:

Heading paragraph with trailing space

then when you press Return and continue typing text, Pages fails to switch to the body style and continues with another paragraph still in heading style:

Heading paragraph with trailing space

This is clearly due to the trailing space after the insertion point. The problem is that, unless the “Show Invisibles” option is on, it is pretty much impossible to see such trailing spaces at the end of paragraphs, and it is a situation that can occur far too easily.

I can understand the rationale behind the decision not to switch styles when the Return key is pressed while the insertion point is in the middle of a paragraph rather than at the end of it, but I think that Apple should make an exception when the only thing that there is after the insertion point is an invisible trailing space (or tab character, for that matter).

I’ve submitted another bug report with the 100% reproducible scenario and my suggestion. Whether they’ll ever do something about it is, of course, another question…

For the record, the problem in Word is most definitely a bug and is not caused by a trailing space. It occurs even if the insertion point is at the very end of the paragraph. It just occurs unpredictably, which of course means that Microsoft will never fix it. (They don’t even fix bugs that occur predictably, so…)


2 Responses to “Pages 2: Trailing space causes ‘Following Paragraph Style’ option to fail”

  1. danridley says:

    This seems to have been partially fixed in 3.0. If there is exactly one trailing space, Pages will switch to the “next paragraph” style. Two spaces, or any other whitespace (including a non-breaking space), and it still won’t.

  2. Pierre Igot says:

    Good Lord. Oh well, I guess it’ll have to do. Thanks.

Leave a Reply

Comments are closed.