Site logo

Roman to arabic

This is a quick & dirty script for InDesign written in reply to a post on Facebook. As the name suggests, it converts Roman numbers to Arabic.

Function roman2arabic was written by Kenshi Muto. The rest was done by Kasyan Servetsky.

Before

After

The script finds Roman numbers using this GREP:

Any number of these characters — I V X L C D M — within word boundaries. If you know a better regex, please let me know.

I tested it quickly using a simple document. At first sight, it works properly: as you can see in the screenshot above, the formatting is not lost while the script changes the contents of a number. But I am not sure if it would work for complex files. Also, it may cause some undesirable effects, for example, when changing a king’s name: e.g. Charles XIII or Nicolas II.

Click here to download the script.