Adobe InDesign CS4/CS5/CS6: Got Fractions?

by Barb Binder, Adobe Certified Instructor on Adobe InDesign CS6

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:

InDesign CS4/CS5: The Glyphs Panel

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 as InDesign CS4/CS5: Sample 1/2 Fraction? With the right fonts, you can, and it’s easy! Here’s how:

  1. Assuming that the fractions appear in your body text paragraphs, begin by creating a new Paragraph Style called “Body Text” 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:
    InDesign CS4/CS5: New Paragraph Style dialog box
  2. 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:
    InDesign CS4/CS5: GREP Style
  3. 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+):
    InDesign CS4/CS5: Edit the GREP code to read \d+/\d+
  4. Add a character style to the string by chosing New Character Style from the Apply Style drop-down list:
    InDesign CS4/CS5: Create a New Character Style
  5. 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:
    InDesign CS4/CS5: Set the OpenType Feature to Fractions
  6. 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!
    InDesign CS4/CS5: Automatic Fractions

AUTHOR’S NOTE: 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:

ss_002

and the denominators:

Adobe InDesign: Glyphs panel shows denominators

However, if you change the font (on the bottom row of the Glyphs panel) to Birch (another OpenType font):

Adobe InDesign: Change the font to Birch

You will notice that it does not have numerators and denominators, therefore, the technique shown above will not work.

Adobe InDesign: Birch, an OpenType font, doesn't offer numerators or denominators

If you’d like to receive notifications about future Rocky Mountain Training blog posts, our classes or just want to stay in touch, please like our Facebook page.
Know someone who would benefit from this article? Share it with your friends and colleagues.
Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+Email this to someone
This entry was posted in Adobe InDesign and tagged , , , , , , , , , , , . Bookmark the permalink.

10 Responses to Adobe InDesign CS4/CS5/CS6: Got Fractions?

  1. Hi Barb
    To be sure don’t find date like this 12/05/70, you can write this regex:
    (?<!\d)(?<!\d/)\d+/\d+(?!/\d)(?!\d)
    (cf. M. Murphy, Adobe InDesign Style)
    Bonne journée

  2. Barb Binder says:

    Nice catch, Laurent. I would have been caught by surprise at the first date appearing in my document. Thank you for the comment et bonne journée à vous, aussi.

  3. Pingback: InDesignSecrets » Blog Archive » This Week in InDesign Articles, Number 32

  4. David Ruberg says:

    Wow! Something very useful that I didn’t already know. Thank you.

  5. Nolan Addison says:

    I tried this, but it is only converting the standard fraction like 1/2 and 3/4. Am I missing something?
    @Barb Binder

  6. Barb Binder says:

    Hi Nolan:

    Make sure you are using an OpenType font that offers numerators and denominators.

    ~Barb

  7. Annette says:

    We have to make fractions in our textbooks with a horizontal line dividing the numerator and denominator. It’s a real pain! Do you have any suggestions other than what we’re doing now: creating them and then using them as in-line graphics…

    I haven’t been able to find a font that does this.

    Thanks!

  8. Barb Binder says:

    Excellent question, Annette. The OpenType options are geared towards slash fractions. You could set up your horizontal fractions as text by using a combination of kerning, baseline shift and an en dash, but it’s still pretty darn tedious. How about collecting all of your fractions graphics into an InDesign Library item? At least it’s visual, and you could drag and drop them into place. Or, create all of the horizontal fractions as text once, and then put them in the library? There’s no perfect solution for you yet. :(

  9. Jay Alan Babcock says:

    Just what I needed! Thanks for the clear instructions.

  10. Benny says:

    Excellent tip and structure of the styling. Thx.

Add Comment Register

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>