« How to. Create a Button that links to First Page of my PDF | Main | New Australian InDesign Blog and Tutorials »
How do I create fractions in InDesign?
By Cari Jansen | August 25, 2008
InDesign out-of-the-box, does not contain a ‘Make Fraction” command, like other applications such as QuarkXPress have, so if you’re a Quark converter (Welcome a-board by the way!!!), how do you go abouts creating fractions in InDesign?
So how can setting fractions be made easier? Well, there are a number of options available. Let me take you through five different methods…
Option 1 - Use OpenType font with fraction support
Quite a few OpenType fonts you use a font such as Adobe Garamond Pro, which has really good fraction support, creating fractions is pretty easy. Type the fraction e.g. 1/2, highlight the text, then from the Character panel menu select OpenType > Fractions.
Alternatively, select OpenType > Fractions from the Control Panel menu or select OpenType > Fractions in the Character Style Options dialog.
If you regularly use this feature consider applying a shortcut to this comment, by choosing Edit > Keyboard Shortcuts, then select Product Area > Panel Menus and scroll down to Character:OpenType:Fractions, set Context to Text, seen as you’d only apply this shortcut when working with text and for instance choose shortcut Command+Shift+F (Mac) or Ctrl+Shift+F (Win). Click Assign, to add the shortcut to your shortcut set. If you’ve not yet created a new shortcut set you’ll be prompted to create a new set. Click OK to acknowledge the changes made and close the Keyboard Shortcuts dialog.
The advantage of using the OpenType Fraction feature, is that you can easily resize your text and the fractions will remain typographically correct. Something the “Make Fraction” command in QuarkXPress for instance doesn’t do, as it simpley resizes the text before and after the ‘/’ and amends the baseline shift when generating fraction.
Option 2 - Find/Change with OpenType support
Ok, so you’re using a OpenType font with fraction support. Yay!!!
With Find/Change you can to set your all fractions in one hit! Using the GREP feature, now, that would save some time.
Set Find what:
Wildcards > Any digit \d
that is Repeated > One or More Times \d+
followed by a slash-character \d+/
followed by another Wildcards > Any digit \d+/ \d
that is Repeated > One or More Times \d+/ \d+
Set Change to:
Select Found > Found Text $0
Set Change Format:
Style Options: Character Style > fraction.
This fraction Character style, would just enable the OpenType Features setting for Fractinos.When using Superscript Position setting, you’ll have to have a bit of a play with the Edit > Preferences > Advanced Type, superscript Position and Size settings for the document to ensure you generate the best looking fraction for the font you’re using.
Next… click Change All.
Option 3 - Use a Script
You’re using a font that doesn’t support Fractions? Bummer… Naaaaah… not really… Dan Rodney developed a Proper Fraction script that helps you generate fractions. The Proper Fraction script is available in Free format as well as low cost Pro Script (that finds all fractions and formats automatically).
The Free Script allows you to highlight some text, then generate the fraction either by running the ProperFraction 2.0-Size DanRodney.js script which really replicates what the “Make Fraction” command in QuarkXPress does (e.g. reduce font size, set baseline shift). I’d vote for not using this particular script as it has the same limitations when text is resized later on.
The second sript ProperFraction 2.0-HScale-VScale DanRodney.js is a bit better in that it utilises a combination of horizontal and vertical scaling and baseline shift. Although text resizing is still an issue, due to the baseline shift, which Rodney acknowledges in his notes for the script, he also recommends the quick fix to use after resizing text, which is utilising Find/Change to correct the baseline shift values as required.
Option 4- Find/Change no OpenType support
Ok, you want to set fractions for your core body text and don’t want to pay for a script and are not using an OpenType font with Fractions support?
Well here’s one way of fixing things… still a multi-step process…
Let’s look at using Edit > Find/Change again… and use GREP once more…
Set Find what:
Wildcards > Any digit \d
that is Repeated > One or More Times \d+
followed by a slash-character \d+/
Set Change to:
Select Found > Found Text $0
Set Change Format:
Style Options: Character Style > superscript.
This superscript Character style, would just set the Basic Character Position to Superscript and if I may recommend, also set the Kerning setting to Optical. If your text is formatted with an OpenType font that supports Denominator and Nominator font settings, then utilise the Nominator OpenType feature.
When using Superscript Position setting, you’ll have to have a bit of a play with the Edit > Preferences > Advanced Type, superscript Position and Size settings for the document to ensure you generate the best looking fraction for the font you’re using.
Next… click Change All.
Continue with the following Find/Change command:
Set Find what:
A slash-character /
followed by Wildcards > Any digit / \d
that is Repeated > One or More Times /\d+
Set Change to:
Select Found > Found Text $0
Set Change Format:
Style Options: Character Style > subscript.
This subscript Character style, would just set the Basic Character Position to Subscript and if I may recommend, also set the Kerning setting to Optical. If your text is formatted with an OpenType font that supports Denominator and Nominator font settings, then utilise the Denominator OpenType feature.
When using Subscript Position setting, you’ll have to have a bit of a play with the Edit > Preferences > Advanced Type, superscript Position and Size settings for the document to ensure you generate the best looking fraction for the font you’re using.
Next, click Change All.
Ok, so at this stage you would have ended up with a document that has fractions looking like this:
What we really need to do at this stage is locate all the /-characters in the fractions and turn the default slash character to a “fraction slash”.
Set Find what:
A slash-character /
Set Find Format:
Style Options: Character Style > subscript.
What we’d like to do at this stage is change that slash to a Fraction Slash. We’ll have to discover what the Unicode character for that is.
For my font ‘2044′. We’re now ready to set the Change To settings.
Set Change to:
\x{2044} (use \x{nnnn} and replace nnnn with the Unicode).
Set Change Format:
Style Options: Character Style > [None]. (to remove the subscript style).
Basic Character Formats: Normal (to remove the subscript)
Change All…
Wow, that is a lot of steps to get some fractions set in your document.
Luckily InDesign comes pre-installed with the FindChangeByList.jsx script that allows you to perform multiple finds in ONE hit! So yes, you can perform all of the preceding tasks in a single hit.
Option 5 - FindChangeByList
The FindChangeByList.jsx script utilises a text file located in the InDesign CS3/Scripts/Scripts Panel/Sample Scripts/JavaScripts/FindChangeSupport directory, called FindChangeList.txt as way of setting a series of Find/Changes and applying them as a single command.
If you rename the default .txt file in this directory - which is the text file containing instructions the script uses by default - and create a new file called ‘fractions.txt’ somewhere, you’ll prompted to point to the .txt file that contains your Find/Changes when running the script.
Rather than typing out all of the previously set Find/Change settings (option 4), I’ve attached a sample .txt file for you to use, simply change your style names and the script will work for you too!
The one thing that you’ll have to do is to adjust your Preferences > Advanced Type > Character Settings for Superscript and Subscript to provide the best positioning and sizing for the core font you’re using.
Here’s a link to the fractions.txt file I’ve created as a sample for you.
Topics: GREP, adobe, fonts, indesign, scripting |






October 4th, 2008 at 4:20 am
Hello there,
I am designing a 700 page cookbook and many of the fonts I want to use aren’t open type but do have some fractiosn built into the type: 1/2, 1/4 and 3/4. But if I need 2/3 and 1/8 etc, is there a way to create these and add them to the glyph palette with the rest, or do I need to run the scripts you have showed above?
Thanks for you help,
Rachel Pedersen
November 3rd, 2008 at 4:33 am
Cari Jansen, hello!
Try this script:
http://adobeindesign.ru/wp-content/uploads/2008/11/find_change_by_lists.zip
This script works with several lists of Find/Change