Indent-to-here, and using GREP to insert it


This entry originally appeared in July, 2010 on What They Think.

A seldom-used, but extraordinarily powerful command in InDesign is the Indent-to-here command, which is generated by hitting Command-\ (Control-\ on Windows) at the point where you want an indent to occur.

You can accomplish the same thing by using a Paragraph Style with indents, the first of which is a negative indent, followed by one or more tab characters to establish the subsequent indentations.

The benefit of Indent-to-here is that you can decide to create an indentation anywhere using the command, and all of the text from that point onward will be indented, until the next carriage return. “Soft Returns” are included in the indent, so they don’t cancel the effect.

When I write tests I use Indent-to-here a lot. Anytime a question or possible answer exceeds one line, I use Indent-to-here to hold the indentation point of the question or the answer.

The advantage of using Indent-to-here is that you can do different things on each line. In some cases the question takes more than one line; in other cases the answers take more than one line. In either event, the Indent-to-here command allows you to set the indent contextually.

This paragraph of text is “normal” in that it runs-on. It can be made better by using the Indent-to-here command in InDesign (QuarkXPress also has one).

This second example has Indent-to-here placed before the “Suppose” which causes all text from that point, until the next carriage return, to be indented there.

Indent-to-here will work anywhere. Though illogical, the paragraph above demonstrates this concept. Wherever you put it, indentation stays there.

The second phase of this topic is getting the Indent-to-here command in there without having to go to the trouble to typing it in. InDesign supports what are called GREP searches, which is geek-speak for some very powerful search and replace functions that use “regular expressions” as either the search string or the replacement string.

Using Find and Change in InDesign, and using the optional GREP functions, it is possible for me to search-and-replace all of the numbered paragraphs (questions) with an Indent-to-here command. And, using similar search strings, I can replace all of the alphabetic answer lines with an Indent-to-here command. These differ only in that answer lines have a slightly different structure: tab, letter, period, tab, copy. And, each one is a letter as opposed to a numeral.

The example here shows the use of GREP to search and replace, adding the Indent-to-here command into the text.

GREP can search for numerals (one or more in this case) and replace with a string, and then it can search for tab followed by a single letter followed by a period and a tab. GREP can differentiate between capital and lower case letters if you want.

My solution is to insert the Indent-to-here command at every likely spot in a test where it might be helpful. In those lines where its function is moot, it is harmless. In any line that exceeds the line length, the Indent-to-here command causes the text to look, and read better.

This simple command is a life-saver for excellent typography.

About Brian Lawler

Brian Lawler is an Emeritus Professor of Graphic Communication at California Polytechnic State University, San Luis Obispo. He writes about graphic arts processes and technologies for various industry publications, and on his blog, The Blognosticator.
This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Indent-to-here, and using GREP to insert it

  1. Chandru says:

    I’ve many doublet poems which are formed in this way:

    Verse 1:
    Hallowed by thy name,
    O my Lord

    Verse 2:
    Any isms I do not mind,
    Atheism is my real find.

    Like this and so on. My task here is to center align all the first lines of each of the verses. Then I’ve to align the second line in such a way that the two are vertically straight.

    Also, All first lines are by default center aligned.

    i.e

    Desired output

    Verse 1:
    Hallowed by thy name,
    O my Lord

    Verse 2:

    Any isms I do not mind,
    Atheism is my real find.

    is there any technique to achieve this? can we make a grep to acheive this?

    • Brian Lawler says:

      Hi Chandru,

      The formatting of your question was lost in the WordPress comments formats, but I am aware of what you want to accomplish.

      If you are using InDesign you can certainly use GREP, or just the simple Find-and-Change to do this kind of formatting.

      GREP has the advantage in InDesign of being able to search for, or change the “embed here” command, which is Command-\.

      You could also do this kind of formatting using standard Find and Change with preset Tab stops, and inserting tab characters in the lines you want to indent (Command-Shift-T for the tab ruler).

      Please write back if this does not answer your question.

      Brian

  2. Chandru says:

    Dear Brian,
    Thank you so much for your reply,
    I’m very glad to recieve some information from you.

    If you notice for instance the line
    “Hallowed be thy name” is at a distance of 25 mm from left margin i.e H is 25 mm from left. The whole document is center aligned, so there is no necessity of formatting on the first lines of the doublet.
    Consider the second line -“O my lord” The word O is 30 mm from left margin. I have to make the second line beginning at a distance of 25 mm from left. i.e O is in perfectly in line with H of first line i.e. 25 mm.

    Please help me out as I am not clear regarding how to align the second line in same distance as the first line. There are 1000s of verses like these and manual working on all of them will finish all of my time. A little insight on how to achieve this would help a lot.

    Greatly appreciated for your time and help.

Leave a Reply to Brian Lawler Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.