BACK TO BLOG LIST

SUBSCRIBE: RSS ATOM

Updates to Page Numbering Print-Shanty

by NJB // // Silverthorne, CO

© 2024 Nicholas Bernhard

CC-BY-SA 4.0

One of my goals with print-shanty has been to include roman-numeral page numbers. This is the proper format for the “front matter” of a book, which includes forewords, prefaces, acknowledgements, introductions, and prologues.

The advantage of doing it this way is that you can have the first chapter of your book start on page one, which looks cleaner.

Tonight, I got it to work!

Tricky Page-Numbering

Page numbering is tricky, because there are a number of pages that can be added before getting into the actual text of the book. The actual chapters of the book are prepended with: a half-title page, a blank page, a full-title page, a copyright page, an optional dedication, and a table of contents. The table of contents may not fit on one page, so its length has to be calculated and added to the total number of pages. There are some other parts I should add, like acknowledgements and a frontispiece.

My Process for Front-Matter, Roman-Numeral Page Numbers

First, I hard-coded a table of Roman numerals for numbers up to 50. At a later point, I may write a script that writes out a roman numeral for any integer, but for now, the table will do.

Note: When I say ‘table’ I usually mean an array of JavaScript objects. I use these ‘tables’ for values that I’ll be using a lot in a particular script and that I won’t need to change.

Then, I added a new bit of syntax: @at@at@pagenumstart. This tells the script to number all the pages before and up to this page as the front matter, and all the pages afterward as the “body matter.” To start the front matter at page one, you take the normal page number, and then subtract the number of pages that came before it. You then do this for all subsequent pages.

Here’s some examples from an upcoming paperback edition of Ebony and Crystal, a poetry collection by Clark Ashton Smith (public domain):

Table of contents for Ebony and Crystal by Clark Ashton Smith. The Preface, part of the front matter, is on page xiii, while the first poem, Arabesque, is on page 1.

Above: The table of contents

The preface from Ebony and Crystal by Clark Ashton Smith, showing page number ‘xiii’ at the bottom.

Above: Preface from Ebony and Crystal on page xiii.

The poem Arabesque from Ebony and Crystal by Clark Ashton Smith, with page number ‘1’ at bottom-center.

Above: The first poem in the book, page number ‘1’.

FIXING A BUG

I have also worked on a long-term page-numbering bug. In the tables of contents for some books, the page numbers were off by one. I realized tonight that this was because some pages were not being counted.

The table of contents always starts on the right side. If a table of contents is an odd number of pages, my script adds one more blank page, so that the next text content, like an introduction or the first chapter, will also be on a right page. That extra blank page was not being counted toward the page total.

Glad that’s over.

HOW AM I LIKING THIS WEEK’S OTHER UPDATES?

Over the weekend, I updated the script so that book projects are in their own separate folders. This is working well. Now that I can work on more than one project at once, I was able to compare projects in a way that I could not previously, which let me fix the page-numbering bug.

SHOW/HIDE COMMENTS
  • No comments yet.
  • WANT TO COMMENT?

    SEND AN E-MAIL TO NJB@NANTUCKETEBOOKS.COM WITH THIS SUBJECT LINE: