David Blatner |
Thursday, April 04, 2013
No one likes formatting prices, but in this week’s free InDesign Secrets video, Adobe InDesign guru David Blatner shows you how to add custom dollar signs and superscripts for your cents with one single paragraph style. The magic lies with nested styles and GREP styles. Let David show you how these work.
First you need to create separate character styles for each pricing element: one for the dollar sign, one for the cents, and one for the decimal.
To hide the decimal, David suggests creating a character style that changes the font size to 1 pt and change the Character Color to None. David named this style “disappear.”
Go to the Drop Caps and Nested Styles pane. Click New Nested Style. Select your dollar symbol style and apply it through the first character. It is important to change the default Words to Characters in this menu.
Click New Nested Style a third time and apply your disappear style through 1 Characters.
Finally, choose your cents style through 2 Characters.
Click the Preview check box to see the immediate results and click OK to create your new paragraph style.
Now this method only works when your price is in its own paragraph, not inline with other text. To format a price in running text, you need to use a GREP style. This technique still requires the 3 separate character styles for the dollar sign, decimal, and cents.
Choose your dollar symbol style from the Apply Style menu and type \$ in the To Text field.
The dollar sign is a reserved character in GREP and the backslash tells it to treat it as a normal character, not a special code.
Click the @ button and choose Match > Positive Lookbehind from the flyout menu. This inserts the GREP code (?<=).
Between the equal sign and closing parenthesis, type . to ask InDesign to look for a literal decimal character behind our two digits.
Now to make that decimal disappear! Click New GREP Style, choose your disappear style, and type . in the To Text field. Next, click the @ button and choose Match Positive Lookahead from the flyout menu to insert the code (?=). Lastly, before the closing parenthesis, type \d\d.
Both nested styles and GREP styles are great for boosting your efficiency in InDesign. They can seem intimidating at first, but they’re well worth investing some time in—it will quickly pay off. To learn more about GREP styles, check out David’s course called InDesign: 10 Things to Know About GREP.
And for more InDesign insider tips, join Anne-Marie Concepción in a member-exclusive video called Checking out the Gridify tricks.
The InDesign Secrets dynamic duo will be back in two weeks with more tips.
Interested in more?
• The entire InDesign Secrets biweekly series
• Courses by David Blatner and Anne-Marie Concepción on lynda.com
• All lynda.com InDesign courses
• Start a free trial membership at lynda.com
Tags: Adobe InDesign, InDesign, InDesign Secrets, Text Styles, Typography
Check out these popular Design courses.
Thanks for signing up.
We’ll send you a confirmation email shortly.
Sign up and receive emails about lynda.com and our online training library:
Keep up with news, tips, and latest courses with emails from lynda.com.
We've updated our terms and conditions (now called terms of service).Go Review and accept our updated terms of service.