Auto-incrementing ordinals, any way you like


When you have an ever-changing document, it's a chore to keep your numbered sections in order. Blue-phrase answers this challenge with sequencing variables.

When you begin a new writing project, you'll have a broad outline in mind, which over time is enhanced and reorganized into the finished piece. In the interim, any sequence numbers you use to order chapters, sections, illustrations, figures, and so forth, will need to be renumbered each time an addition or rearrangement occurs.

For example, let's say you've settled on a document structure like this ...

1. Introduction
2. Spring-Mounted Racks
3. Lessons from the Field

After writing these, you realize that it would be better to split the first chapter into two separate chapters; to add a new chapter to compare racks and stacks; and to include a personal narrative before the final chapter. The new outline requires everything to be renumbered:

1. Off Road Gearing
2. Suspension Problems
3. Spring-Mounted Racks
4. Racks versus Stacks
5. Taking it for a Test Drive
6. Lessons from the Field

When you use sequencers this renumbering occurs automatically. To do this, simply declare a variable beforehand, and apply the auto-increment operator with each usage. Here's what it might look like:

!var *varname=CHAP *format=digits

section $CHAP++ Off Road Gearing
section $CHAP++ Suspension Problems
section $CHAP++ Spring-Mounted Racks
section $CHAP++ Racks versus Stacks
section $CHAP++ Taking it for a Test Drive
section $CHAP++ Lessons from the Field

This feature can also be used with figures and illustrations, where the subordinate numbering scheme restarts with each chapter, like this:

!var *varname=TBL *format=digits

caption Table $CHAP.$TBL++ History of Suspensions
caption Table $CHAP.$TBL++ Market Value by Suspension Type

caption Table $CHAP.$TBL++ Spring/Mass Ratios
caption Table $CHAP.$TBL++ Early Development Efforts

caption Table $CHAP.$TBL++ Take Aways

The compiled HTML would look like this:

<section>1 Off Road Gearing</section>

<section>2 Suspension Problems</section>
<caption>Table 2.1 History of Suspensions</caption>
<caption>Table 2.2 Market Value by Suspension Type</caption>

<section>3 Spring-Mounted Racks</section>
<caption>Table 3.1 Spring/Mass Ratios</caption>
<caption>Table 3.2 Early Development Efforts</caption>

<section>4 Racks versus Stacks</section>

<section>5 Taking it for a Test Drive</section>

<section>6 Lessons from the Field</section>
<caption>Table 6.1 Take Aways</caption>


The sequence number can be emitted as digits, letters, and other special symbols using the *format attribute. Here are the possibilities:

*format example
DIGITS 1 2 3 . . . 9 10 11
DIGITS2 01 02 03 . . . 09 10 11
DIGITS3 001 002 003 . . . 099 100 101
DIGITS4 0001 0002 0003 . . . 0999 1000 1001
roman i ii iii . . . ix x xi
ALPHA a b c d e . . . x y z aa ab
GREEK Α Β Γ Δ Ε . . . Υ Φ Χ Ψ Ω
greek α β γ δ ε . . . υ φ χ ψ ω
numericgreek αʹ βʹ γʹ δʹ εʹ . . . ιʹ κʹ λʹ μʹ νʹ . . . ρʹ σʹ τʹ υʹ φʹ
NUMERICGREEK Αʹ Βʹ Γʹ Δʹ Εʹ . . . Ιʹ Κʹ Λʹ Μʹ Νʹ . . . Ρʹ Σʹ Τʹ Υʹ Φʹ
abjad ا ب ج د ه و ز ح ط
hebrew א ב ג ד ה ו ז ח ט י יא יב יג יד ט״ו ט״ז יז יח יט
Further Reading

BLUE-PHRASE Basics Getting started with symbolic endophrasing. Learn how to author documents with many of the commonly used typographic techniques found in word processors, by using BLUE-PHRASE symbolic endophrasing. There are only a few basic rules to learn.

BLUE-PHRASE Essentials A primer for effectively using BLUE-PHRASE. Learn the essentials necessary to effectively use BLUE-PHRASE, and discover techniques to perform commonly occurring tasks with greater ease using shorthand notation.

BLUE-PHRASE + CSS The fundamentals of styling Learn how to style BLUE-PHRASE with Cascading Style Sheets.

BLUE-PHRASE Quick Ref Syntax cheat sheet A quick reference to BLUE-PHRASE syntax.

Related Sites

BLUE-PHRASE HTML templating and blogging. A computer language for solving problems related to reading, writing, and publishing.

RWSERVE Caching HTTP/2 server with dynamic JavaScript plugins. HTTP/2 is all about speed: fewer bytes, reduced latency, longer connections, multiplexing and prioritization.

READ WRITE GROK A different take on a tech blog. Follow along as Tangled Web Services boldly goes where tech has gone before.

Contact Us

Read Write Tools is able to offer free and low-cost software products because it has low overhead and limited staff. We are happy to answer your customer service and technical support questions when our self-service options aren't able to meet your needs.

Many of the most common customer service issues can be resolved without our help. Check the licensing and accounts pages for ways to resolve issues related to registration, customer numbers, passwords and access keys.

Technical support issues can sometimes be resolved using one of the public forums like Stack Overflow, so search for error messages, blue-phrase syntax questions, and technical problems there. For best results include the name of the product in your search, like rwdoc, rwreuse, rwserve, etc.

For problems that you can't resolve yourself, ask for help.


Twitter @ReadWriteTools Latest announcements from our developer advocate.

Medium @joehonton Using distraction-free tools for better reading, writing and publishing, and loving it!


Copyright © 2020 Read Write Tools, All Rights Reserved.

Software Licensing

Read Write Tools Software License Agreement. The ReadWriteView, ReadWriteNote, ReadWriteDoc, and ReadWriteReuse desktop applications; and the ReadWriteServe server software may be used only in conjunction with the purchase of a software license.

BLUE PHRASE Software License Agreement. The Blue-phrase processor and Blue-phrase symbolic endophrasing may be used only in conjunction with the purchase of a software license.

Read Write Tools Open Source Software. Read Write Tools publishes some of its software portfolio under open source licenses, including RWSERVE plugins, web components, CSS style sheets, editor themes, command line build tools, and Node.js libraries. These are covered by two different open source licenses: the MIT license or the Creative Commons CC-BY-NC-ND 4.0 (Attribution-NonCommercial-NoDerivatives 4.0 International). See each individual file or its associated README file to learn which applies.

Privacy Policy

Data We Obtain From You

  • While you are browsing our website, we log all HTTPS requests from your browser and all responses by our servers.
  • Each time you use our software, we verify the authenticity of your license key using the device address of your computer, and the IP address of your computer network. We use this data to prevent piracy, and to block unlicensed use of our software.

Data Retention

  • We store site visitor log data for a minimum of 90 days.
  • We retain your customer number, license keys and purchase history for a minimum of three years.

Obtaining a copy of your data

  • You may login to your account using the customer number we assigned to you, and the password chosen by you, to view and print all of the data we retain about you.

Data sharing

  • When you purchase a license to any of our software products, we forward payment information from you to a PCI DSS compliant payment processing gateway.
  • We do not sell or share any information with third parties for the purpose of marketing.
Refund Policy

Refund Policy Our goal is customer satisfaction. If, in your opinion, we haven't met our goal, we will refund the unused, pro-rated portion of your license fee.

Auto-incrementing ordinals, any way you like