Home > Computing, Macintosh, Taodyne, Technology, User interfaces > Adding chapter numbering in Apple Pages

Adding chapter numbering in Apple Pages

At Taodyne, we mostly use Apple Pages to create our documents. For large documents, I’d like to be able to create numbered chapters, something like “Chapter 1″, “Chapter 2″, and so on. Apple Pages does not seem to have that feature. Let’s not get used to it,  and let’s fix it.

Apple Pages can read numbered chapters from Word

One thing that I observed is that when you read a Microsoft Word document that contains numbered chapters, Apple Pages preserves that formatting. In other words, if the user interface may not know how to edit numbered lists with text in them, the rendering engine knows how to render them, and the regular editing within Pages will correctly renumber these documents.

To verify that my recollection of this capability of Pages was correct, I first created a document in Microsoft Word that looks like this:

Section 1 – Hello

Chapter 1 – This is a chapter

I. This is a numbered section

1. This is a numbered sub-section

It doesn’t just “look like” this. The Section and Chapter text were edited in the Numbering section of Microsoft Word, so this is auto-numbering.

Then I saved this document to disk, and imported it into Pages. And indeed, when I edit it in Pages, numbering works just like in Microsoft Word.

The Pages XML format

Let’s look inside the document to see what’s there. A quick tour through the command line shows that Apple Pages documents are really zipped collections of files, including XML files representing the document itself:

% unzip Hello.pages 
Archive:  Hello.pages
 extracting: thumbs/PageCapThumbV2-1.tiff  
 extracting: QuickLook/Thumbnail.jpg  
 extracting: QuickLook/Preview.pdf   
 extracting: buildVersionHistory.plist  
  inflating: index.xml

The most interesting of these documents is the index.xml file. It contains the actual description of the document in XML format. And if I look inside, I see something interesting:

<sf:list-label-typeinfo sf:type="text"><sf:text-label sf:type="decimal" sf:format="Section %L -" sf:first="1"/>

So this sf:format= accepts a rather general format, with %L serving as the marker for where the number should go.

The solution for adding chapter numbers

So the solution for adding chapter numbers is simple:

  1. Once, you will need Microsoft Word to create a document that has the kind of chapter numbering that you need. You may have multiple levels of numbering (e.g. chapter, section, etc).
  2. Import this document in Pages. This will give you a new list style.
  3. When you want to number chapters, select the given list style.
  4. To edit the formatting of the numbering text, select the whole line, change colors or fonts, and in the list style, select “Redefine style for selection”. In other words, the list style defines the font and color for the numbering independently from the paragraph style, and can do that for multiple levels.

Now, you have proper chapter numbering in Apple Pages.

About these ads
  1. John Doe
    January 16, 2013 at 6:57 pm | #1

    Radar?

  2. Gilles/
    January 17, 2013 at 7:24 pm | #3

    Hi Christophe,

    what about using the inspector ? in the Text tab , the list panel will give you what you are looking for:

    Let’s suppose you have following chapter and sections:
    chapter 1
    section 1
    section 2
    chapter 2
    section 1
    section 2

    Click on chapter , select inspector , Text, List : select Indent Level1 , select Numbers in “bullets and numbering” , change the numeratation format is requested, and now you have a 1. before chapter 1

    Do the same for section but select indent 2 and 1.1 is now before section 1

    Continue with the same process and you will obtain:
    1. chapter 1
    1.1 section 1
    1.2 section 2
    2. chapter 2
    2.1 section 1
    2.2 section 2

    my 2 cents

    Gilles.

    • January 17, 2013 at 11:22 pm | #4

      Gilles,

      What I want to do is to have:

      Chapter 1. Hello
      Chapter 2. World

      Not:

      1. Chapter Hello
      2. Chapter World

      The trick above is a way to achieve that objective.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 365 other followers

%d bloggers like this: