Pages 2: Last paragraph in document modified even when it doesn’t appear to be selected

Posted by Pierre Igot in: Microsoft, Pages
March 10th, 2006 • 3:04 pm

I am afraid that there is something fundamentally wrong with the way that Pages handles the very last paragraph in a document.

In fact, the core of the problem is precisely that it is not a paragraph. And this has pretty serious consequences.

Take the following situation:

Pages document with empty last paragraph

This is a Pages document containing two paragraphs. The first paragraph contains a couple of words (“Para 1”) followed by a paragraph mark. (I have made invisible characters visible here.) The second paragraph is still empty, but, from a visual point of view at least, it already exists, since the blinking insertion point is very much visible at the very start of this second paragraph, i.e. on the line coming after the paragraph mark marking the end of the first paragraph.

Yet consider what happens now. If I select the first paragraph (including its paragraph mark), I get a selection that looks like this:

First paragraph selected

I don’t know about you, but this, to me, looks like a selection consisting of a single paragraph, i.e. the first paragraph in the document.

However, if, once this is selected, I apply a paragraph formatting change—for example, if I make the paragraph centered instead of left-aligned—Pages applies the change not only to the selected paragraph, but also to the second (empty) paragraph that follows it!

Indeed, if, after having changed the alignment of the selection (i.e. the first paragraph), I press the Right cursor key or click back on the second line to put the insertion point back there, the insertion point will now appear in the middle of the page, i.e. in a centered position!

Now, this only happens if the last paragraph happens to be empty. If the last paragraph contains anything (a letter, a word, a setence, etc.) and I do the exact same thing as described above, Pages, does not change the alignment of the last paragraph and behaves correctly.

But if the paragraph is still empty, Pages actually changes the alignment of the paragraph, even though it does not appear to be selected at all and I certainly did not intend to select it and apply the text alignment change to it.

This might sound like a small issue, but it is not, because have an empty last paragraph in a document is a very common situation. There is nothing unusual about the following scenario:

  1. Create a new document.
  2. Type a paragraph of text.
  3. Press Return to end the paragraph and start a new one.
  4. Go back with the mouse (or the keyboard) and select the first paragraph.
  5. Change the text alignment of the selection.
  6. Go back with the mouse (or the keyboard) to the last paragraph after the selection.

This is a very common scenario. And, in such a scenario, Pages behaves improperly and also changes the text alignment of the empty last paragraph, thereby forcing you to change it back manually.

This applies to any formatting change, not just to text alignment. Any formatting changed applied to the second last paragraph also applies to the last paragraph if that last paragraph happens to be empty.

Like I said at the beginning of this post, this problem appears to be due to a fundamental flaw in Pages. And that flaw is quite simply that the last paragraph of a Pages document does not have its own paragraph mark. Because of this, Pages obviously has to make an exception for the last paragraph and support specific paragraph formatting options for it even though it doesn’t have its own paragraph mark.

And obviously Apple’s engineers neglected to make sure that the exception would apply even when that last paragraph is still empty. As I said, if it’s not empty, there aren’t any problems. Pages does support specific paragraph formatting options for the last paragraph as soon as it contains any kind of text. But if it’s empty, it’s as if it didn’t exist—even though it very much exists visually, since there is an I-beam cursor blinking in it!

Compared this to Word. In Word 2004, when you create a new blank document, here’s what you get:

Empty document in Word

As soon as the document is created, even before you start typing anything, the document already contains a paragraph mark. It’s the paragraph mark for the last paragraph in the document. And it’s always there. You can never put your I-beam cursor beyond that last paragraph mark.

And of course the problem described above doesn’t occur in Word.

In this case, I am afraid Microsoft got it right, and Apple got it wrong. They could still fix it without making major architectural changes, just by ensuring that the exception that they have quite clearly implemented for the last paragraph in a document also applies when that last paragraph is still empty. But with the way things are going with Pages, we might have to wait for Pages 5.0 before anything happens.

And until then, Pages users will have to live with the very real problem of constantly having to undo paragraph formatting changes that are applied to the empty last paragraph of their document when they should not be.

(Another workaround is to start a new document by inserting a few blank paragraphs at the bottom of it, and then insert new paragraphs above these last few blank paragraphs, so that you never have to deal with the very last paragraph of the document. But this is easier said than done. I have been using Pages for over a year now, and I still forget to do this and to always ensure that there are a few blank paragraphs below my current location in my pages document. Of course things are not helped by the fact that, when editing a fairly long document, you often jump back and forth in the document using the command-Up and command-Down shortcuts to go straight to the very beginning or to the very end of the document. There is no shortcut for going straight to the last paragraph minus a few empty paragraphs.)

4 Responses to “Pages 2: Last paragraph in document modified even when it doesn’t appear to be selected”

  1. danridley says:

    If I select the first paragraph (including its paragraph mark)

    Your parentheses give the game away — if you don’t want to affect the following paragraph, just don’t include the paragraph mark in your selection.

    From the keyboard, this behaves exactly like I would expect. If I type a paragraph, then hit Enter, I have two options from the empty line: if I press Option-Shift-Up, to select upward one paragraph from the insertion point, changes affect the current (new/empty) paragraph, as well as the previous one (the one I just typed).

    If, instead, I press the back arrow once, then Opt-Shift-Up, changes affect just the previous paragraph; then Cmd-Down and I’m back in my empty paragraph (and original style).

  2. danridley says:

    Um, I’m not sure what I did there, but I didn’t intend to bold my first paragraph above. I’m not trying to shout, honest. :-)

  3. Pierre Igot says:

    The paragraph in bold is probably due to WordPress CSS weirdness caused by improper HTML code. You had an opening blockquote followed by an opening p followed by a closing blockquote followed by a closing p. Not good :). I fixed it. I guess you need to make sure to insert a CR after you closing blockquote.

    As for your actual comment, I am afraid I don’t agree that things are expected.

    First of all, the paragraph mark at the end of a paragraph is very much part of a paragraph. If you use the mouse shortcut to select an entire paragraph (triple-click), it definitely selects the paragraph mark as well.

    Then there is the fact that there is nothing that says that selecting a paragraph mark actually includes the following paragraph if and only if that following paragraph is the last one in the document and is blank.

    You must agree that this is a very twisted logic.

    As for the particular behaviour you describe, you are just lucky that Pages actually treats a partial paragraph selection as if the entire paragraph was selected when a paragraph formatting option is chosen. This is true whether you select everything in the paragraph up to the paragraph mark (without including it) or just a single word somewhere inside the paragraph. So selecting everything in the paragraph up to the paragraph mark does not equal selecting the entire paragraph. It just so happens that Pages is smart enough to consider that you meant to select the entire paragraph (including the paragraph mark).

    Word doesn’t do that and actually does something “hybrid” by extracting from certain paragraph formatting options—for example, a paragraph style—the formatting options that are character formatting options. For example, if a heading para style including bold, then applying the heading para style to a single word in Word only applies bold :).

  4. danridley says:

    Yes, Word’s behavior in that situation is pretty out there.

    I don’t think treating a blank final paragraph as a special case is quite so twisted as you do, but I’m feeling agreeable and won’t argue the point too much :-)

    I would have expected a triple-click to leave the paragraph mark out of the selection; I’m surprised by that. I tend to select with the keyboard, so I’d never noticed.

Leave a Reply

Comments are closed.