Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

Not sure exactly how to describe this, but here goes...

I have some key/value pairs that I want to display separated by a colon:

Name        : Some Person
Description : A description that 
              can span multiple lines
Department  : D1

The values will be imported from XML at some point. The description value can be short, but also long enough to break into multiple lines. Important is that I don't know how long the description will be up front.

How can I make the description to align with the colons? At this moment this is what I get:

Name        : Some Person
Description : A description that 
can span multiple lines
Department  : D1

I'm using Adobe InDesign CS6.

share|improve this question
    
Try playing around with the 'Tabs' option on the 'Type' menu. Place tabs before and after your colon, select all your text and use the option to put down some tabs of different kinds. –  Vincent Apr 7 at 9:54
    
Thanks, I've tried that. I can actually add a tab before can in the example to fix it. But when I import different content, this won't work :( –  Elmer Apr 7 at 9:56
    
that's probably because it doesn't have the tabs yet -- you'll need to add those by hand or script. –  Vincent Apr 7 at 9:57
    
Okay, you are not aware of a way to align this automatically (without using tables)? –  Elmer Apr 7 at 9:59
    
I guess you could add the tabs using a script, especially since you'd be adding them right in front and right after the colon. I'm a script noob, though, so I can't tell you more than that, I'm afraid. –  Vincent Apr 7 at 10:08

3 Answers 3

up vote 4 down vote accepted

Make a new Paragraph Style. Set tab positions to align the labels, colons and start of the contents of the field. Set the Paragraph Indent and First Line Indent so that the first line of an entry (starting with the label) begins at the left, and any subsequent lines start indented. (The First Line Indent with be the negative of the Paragraph Indent.)

To make the indentation quickly appear in your imported text. Do the following:

  • Select Edit -> Find/Change
    1. Set find what fields value to " : "
    2. Set change to fields value to"^t:^t"
    3. Press Change All

Some finesse, if your text can contain many colons then use grep match for anything except : starting form the beginning of paragraph, and than colon. The GREP expression would look like this:

(^[^:]*?)\s*:\s*

and replace by:

$1\t:\t

Now it can handle possibility of already tabulated text and many other problem variations (but not all).

share|improve this answer
    
Thanks, I'm going to play around with this –  Elmer Apr 7 at 10:53
    
The Paragraph styles work great, thanks! The find/replace I don't really understand, the style works fine without. Anyway, I'll select this as the answer. –  Elmer Apr 9 at 8:16

Looks like you need an 'indent to here' character. Not sure how your artwork is set up, but you could add it to that. There may be a code you could add to the XML to do the same thing.

CTRL-\ or CMD-\ depending on your platform, insert it before the first character of the description.

share|improve this answer

Assuming that your description is one paragraph, set up your style so that the indents force the text to align with the colon. Once you import the text, apply the paragraph style, and everything should line up nicely.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.