Check gamebook section references before you print
A reader follows "turn to 212" and lands on a section that has nothing to do with the choice, or on a number that does not exist. Here is how to catch those links before the book goes out.
Why it happens
A gamebook is a web of numbered sections. Every edit can break a link somewhere else.
- A section is cut or merged: the references to it stay in the text and now point at nothing.
- Sections are renumbered: some references are updated and some are not.
- A section is copied: two sections end up with the same number, so a reference has two possible destinations.
Proofreaders read in page order, not link order, so these errors survive a normal read.
Fix 1, free: keep a link table
- Make a spreadsheet with one row per section.
- In each row, list the section numbers that section sends the reader to.
- Check that every listed number has its own row, and that no number has two rows.
- Mark any section that nothing points to. It may be fine, or it may be a lost path.
This is the most reliable method if you keep it up to date while you write. Building it after the fact for a few hundred sections takes a long time.
Fix 2, free: extract the text and search it
pdftotext "converts Portable Document Format (PDF) files to plain text" (manual page). It comes in the poppler-utils package.
- Run
pdftotext book.pdf book.txt. - Open book.txt in a text editor and search for "turn to", "go to" and any other phrase your book uses.
- Check each number you find against your section headings.
- If a multi-column page comes out mixed up, try again with
-layout, which the manual says will "Maintain (as best as possible) the original physical layout of the text."
Searching is fast. Checking each hit by hand is still the slow part.
Fix 3, paid: let a tool read the references
I make Gamebook Reference Check ($12). It reads explicit English directions such as "turn to 12" and "go to section 12". It flags duplicate section numbers and missing or ambiguous destinations. It exports the findings and their PDF page numbers as CSV. You unzip it and open index.html in desktop Chrome. The download includes a worked sample and a quick-start guide.
It needs a text-based PDF, so scanned books will not work. It looks for explicit English directions, so other wording or other languages may be missed. Review the headings and references it detects, especially in multi-column layouts. It checks the numbers, not whether the story makes sense. There is no free demo.
Which one to use
- Still writing: start Fix 1 now and keep it current.
- A short book, or unusual wording for directions: Fix 2.
- A finished English PDF with many sections: Fix 3 gives you the list to check, with page numbers.