I am working on a lengthy membership directory and would like to find a GREP shortcut for this specific occurance in the directory:
Our member companies often have “dba” [doing business as] names amended to them. In my InDesign file, some of these names fit on one line in the directory, including the dba name. I want to leave those as they are. However, for longer company names with dba's, two lines are required in the layout. Often, the word “dba” is the last word on the first line, following by the dba name on the second line, like so:
ABC Company Inc., dba
XYX Associates
I would like to find a GREP solution to kick the “dba” down to the second line without having to go through the entire directory and add line breaks manually. But if the whole company name (including the “dba”) fits on one line, I don't want those to break–only where the “dba” creates a second line.
So in this example, I want to leave it alone:
DEF Company, dba GHI Inc.
But in two-line examples like this, I want the “dba” on the second line, like so:
JKL Company Limited,
dba MNO Associates
Reading through other posts, I gather that GREP can't do much with regard manipulating the lines within a paragraph in InDesign, but maybe someone knows of a workaround?
One that I thought of is to decide on a certain number of characters on a line and then any time the word “dba” is found after that number of characters, insert a line break before it. However, I do not know how to specify that condition in InDesign (i.e., how to input “Find the first 30 characters of any line that has the word 'dba' in it and insert a line break; but if the line doesn't have 30 characters, don't do anything).
I realize that the solution above is not perfect because I am not using a monospaced font, but still it would probably work for most of the directory, so if someone could supply the GREP for my paragraph above, I would be so grateful.
Sorry for being so wordy! I've spent hours trying to find a solution online and am frustrated.
Thanks in advance for any solutions or advice.