# InDesign

Currently Being Moderated

## Aligning fractions in a column

### Feb 11, 2011 8:35 AM

Hi Folks,

How do I do the following:

In a table, I have a column of numbers, some with fractions, some without. I want to right-align the whole number, which can be one or two digits, and have the fraction be to the right of the numbers...

I can do it by using a decimal tab and aligning to a space, but I don't want a space between the whole number and the fraction. Then I thought I might experiment with using a thin space instead of a regular space, which doesn't work, but what does work is reducing the tracking to -100 by selecting the large numeral and the space after it.

Cool, looks great, EXCEPT: I have 25 pages of tables to align and would prefer to somehow automate the process. I already have to select each cell that has a fraction, take out the extra space (or keep the space and fiddle with the tracking), then apply a script to each fraction to stack it (ProperFraction) .

Suggestions?

Thanks--D

Replies
• Currently Being Moderated
Feb 7, 2013 10:46 AM   in reply to dunaz

Did you ever find the answer to this problem. We are having the same issue at my work. We found your advice very useful, but at the same time we also would like to find a way to apply almost as a style

because of the massive amounts of tables we have to tackle. If you got the answer, a reply would be more then helpful my friend.

-Devin Meek

|
Mark as:
• Currently Being Moderated
Feb 7, 2013 12:47 PM   in reply to dunaz

This might work:

You need a spacebar space between whole number and beginning of fraction.

Make a paragraph style. Within tabs, define a decimal tab. Align on a spacebar space; not a period.

In the same paragraph style, under GREP styles, make a new GREP style like this:

Apply: SpaceReducer character style (you define a new character style that has the Horizontal scale set to, oh, say 25% or season that to your taste)

The To Text: GREP sequence would be \s (any white space)

Also make a second new GREP style below the first one:

Apply: FractionMaker character style (you define a character style that has the OpenType Fraction switch ON and tracking set to -75, or to your taste)

The To Text: GREP sequence would be \d+\/\d+ (which means any digit, one or more times following literally by a forward slash followed by any digit one or more times)

You continue to merely use spacebar space between whole number and beginning of fraction.

Apply, ... and voila! Ooh, that's pretty! All in one table cell!

|
Mark as:
• Currently Being Moderated
Feb 7, 2013 1:01 PM   in reply to Michael Witherell

It's much, much, simpler:

1. If there are any spaces between the numbers and the fractions, remove them.

2. Select the cells that you want to align, then place a decimal tab. Make sure that the "Align On" field is empty.

Done! This behaviour can be exploited for similar types of alignment. For instance, if you have a column with numbers, some of them in parentheses, then aligning the numbers using a decimal tab and nothing specified in Align On will let the closing parentheses hang over, so to speak, so that the all numbers are aligned on the right-most digit.

Peter

|
Mark as:
• Currently Being Moderated
Feb 7, 2013 1:10 PM   in reply to Peter Kahrel

But how then are you building the fractions? Are you supposing vulgar single-character fractions?

|
Mark as:
• Currently Being Moderated
Feb 7, 2013 1:36 PM   in reply to Michael Witherell

Yes, but I don't see why they're vulgar.

|
Mark as:
• Currently Being Moderated
Feb 7, 2013 1:49 PM   in reply to Peter Kahrel

Peter, I hope that I am not misunderstanding you. YOU British folks had the language first, I acknowledge! :-)

Vulgar, in my typesetting training, means common, or in other words a single drawn character that looks like one-half, one-fourth, three-fourths. These are often included in a typeface. I was employing vulgar in the technical typesetter terminology; not as a derogative.

The OP says he was using Dan Rodney's Proper Fraction plugin, so I concluded that all his fractions had to be built up of 3 or more characters. Given the use of an OpenType font, the script from Dan Rodney is unnecessary, since OpenType Fraction can be set as a character style and simply applied passively to the GREP rhythm of digt(s)-forward slash-digit(s)

When I tried your method (and learned something new about the empty align on), it did not work for me. It only worked if the fraction was a pre-built single character. But perhaps I am misunderstanding your direction?

|
Mark as:
• Currently Being Moderated
Feb 7, 2013 2:21 PM   in reply to Michael Witherell

Yes, the method I described works only with single-character fractions, that true -- not with fractions built from components. I didn't see, by the way, that the OP uses Rodney's plugin.

Peter

|
Mark as:
Actions

#### More Like This

• Retrieving data ...

#### Answers + Points = Status

• 10 points awarded for Correct Answers