Skip to main content
Inspiring
July 7, 2023
Question

Formatting Indexes easily help

  • July 7, 2023
  • 1 reply
  • 244 views

Any scripts or add ons for formatting indexes? I am supplied indexes direct from the authors in Word - and they never come as they should do.

 

Example here:

D’Orbay, François, ix, 57, 90, 91, 102, 103, 117, 118, 119, 121, 122, 124, 126, 133, 145, 150, 169, 172, 173, 174, 176, 179-180, 181-182

 

Needs to look like: 

D’Orbay, François, ix, 57, 90–1, 102–103, 117–19, 121–2, 124, 126, 133, 145, 150, 169, 172–4, 176, 179–2

 

Its a pain having to manually go through and correct the page ranges. Must be an easier way to do it. Any ideas?

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Marc Autret
Legend
July 7, 2023

Hi @Matthew5C62,

 

At the scripting level you can use the PageRange module from IdExtenso once you have at hand the original sequence of page numbers.

 

In order to use this solution, you need to include two files:

  1. the latter core package of the framework (presently $$.bin.230518.jsx)
  2. the file $$.PageRange.jsxlib that provides the PageRange features.

 

So your script will look like

#include 'path/to/$$.bin.230518.jsx'
#include 'path/to/etc/$$.PageRange.jsxlib'

$$.load();

// Here you specific code,
// and at some point:
formattedRange = $$.PageRange(originalRange, /*options*/);

// etc . . .

$$.unload();

 

The options of $$.PageRange.format(…) are detailed here.

 

Note. — format is the “automatic” method of the module, so $$.PageRange(…) is just a shortcut of $$.PageRange.format(…).

 

Best,

Marc