Format first lines in index sections

Take this list:

aardvark
ape
bear
beaver
cat
cheetah
cricket

The script applies a named paragraph style to all paragraphs whose first letter changes from that in the previous one. In this example, that would be bear and cat. It optionally inserts section headers, so that the list would look like this:

aardvark
ape

B
bear
beaver

C
cat
cheetah
cricket

When you opt to insert headings, the paragraph style is applied to them.

Use

The script expects a paragraph style called index_skip. To change this, look for this line in the script:

skip_style = 'index_skip';

and enter the name of the paragraph style you want to use. To have the script insert section headings, set insert_letter to false.

The script has no interface; just run it.


Show script (right-click, Save Target/Link As to download)

Back to the main page on indexing

Back to the main script page

Installing and running scripts

Editing a script

Questions, comments? Get in touch