Adobe InDesign: Need Fractions?
by Barb Binder, Adobe Certified Instructor on Adobe InDesign
Updated: Aug 06, 2023. Works on InDesign CS4 and all later versions
Typesetting fractions is no fun, or at least it didn’t used to be. The introduction of OpenType fonts and the Glyphs panel were a great help, allowing point and click access to additional commonly used options:
But what if you need a fraction that isn’t included in the character set? You can manually superscript the numerator, kern the slash, and then go to work on the denominator. Or not! Wouldn’t it be cool if you could just type 1/2 and have it automatically format it into a slash fraction like the one on the line below?
With the right fonts, you can, and it’s easy! Here’s how:
- Assuming that the fractions appear in your body text paragraphs, begin by creating a new Paragraph Style and assign your favorite OpenType face, size and style (in this example, I’m using Adobe Garamond Pro), but don’t click OK just yet:
- To add the automatic fraction formatting, first click on the GREP Style category in the New Paragraph Style dialog box, and then click the New GREP Style button at the bottom:
- Change the To Text code to \d+/ \d+. (In English that means, look for one or more digits ( \d+) followed by a forward slash (/) followed by one or more digits ( \d+):
- Add a character style to the string by chosing New Character Style from the Apply Style drop-down list:
- Give the new style a logical name like Fractions, and then click on OpenType Features category. Click to place a checkmark in front of Fractions:
- Click OK twice to close the open dialog boxes. Assign your new paragraph style to a sample paragraph and start typing numbers, followed by a slash, followed by more numbers. It’s magical!
For this sequence to work you need to a.) use InDesign CS4 or later and b.) use an OpenType font that offers numerators and denominators. Take Adobe Garamond Pro, for example. If you open the Glyphs panel (Type > Glyphs), you can show both the numerators:
and the denominators:
However, if you change the font (on the bottom row of the Glyphs panel) to Birch (another OpenType font):
You will notice that it does not have numerators and denominators, therefore, the technique shown above will not work.
Also, the GREP won’t work for you if you have a whole number, followed by a fraction (i.e., one and a half cups of flour typeset in fraction form). In that situation, add a space—spacebar, thin space, hair space—between the whole number and the numerator. Or, if you are sure that all of your fractions are single digits, you can just change the GREP from \d+/\d+ to just \d/\d to tell InDesign to only match a single digit numerator and denominator. (The plus symbol aftr the \d matches one or more digits, which is why it grabs the leading digit.)
One more important note: this sequence will match dates typed in the same format. For example, today’s edit date of 8/6 would be formatted as fraction. Keep an eye out for dates and consider using words (i.e., August 6) if you have both fractions and dates using the same paragraph style.