How to remove a preceding Line Ending when a variable link is empty

You can set up a variable link to be deleted if it is empty and also to remove the entire line if it becomes empty when the empty variable link is deleted. This deletes the Line Ending that follows the variable link. But what about the Line Ending that precedes the empty variable link? If your text frame is top-aligned, then no worries. However, if your text frame is bottom-aligned, this leaves a space at the bottom (caused by the line ending of the preceding line of text). This article tells you how to address this condition.

VARIABLE TEXT IS LAST LINE IN A STORY

If the variable link will be assigned to text that is the last line in a bottom-aligned story, follow these steps:

  1. Open the Variable Links dialog (DesignMerge > Setup > Variable Links).
  2. On the left side of the Variable Links dialog, select the name of the variable link that will sometimes be empty. This will display its settings on the right side of the dialog.
  3. In the Empty Link pop-up menu, select Delete. This will instruct DesignMerge to delete the variable link when it is empty. Since the variable link will be deleted, the variable link will not add the prefix (the Line Ending prefix will not be displayed in the document).
  4. If you would also like to remove the entire line if it is empty, then select the Remove empty lines check box. This will instruct DesignMerge to remove each line the deleted variable link was on whenever there are no remaining visible characters on the line. This removes the Line Ending character that was at the end of the line that the variable link was on. Below is an example of a variable link with these types of settings applied to it:
  5. When ready, click OK to apply these settings to the variable link and close the dialog.
  6. Next, open DesignMerge Preferences (DesignMerge > Preferences) and select the Smart Tags check box (shown below). Then, click OK to save this change to DesignMerge Preferences.
  7. In the document, use the Type tool to select the text for this variable link and do not include any line ending characters in the selection.
  8. Then, open the DesignMerge panel, select the appropriate DesignMerge panel settings for this text in the document, and click Assign or Replace.
  9. Run a Data Preview merge session to confirm DesignMerge deletes both the variable text and the line ending that precedes this variable text when the variable link is empty.

VARIABLE TEXT IS NOT LAST LINE IN A STORY

If the variable link will be assigned to text that is not the last line in a story, then do the following:

  1. Open the Variable Links dialog (DesignMerge > Setup > Variable Links).
  2. On the left side of the Variable Links dialog, select the name of the variable link that will sometimes be empty. This will display its settings on the right side of the dialog.
  3. On the right side of the Variable Links dialog, select the Prefix check box and enter an MPS Tag or an InDesign Tag to represent either a New Line character or a Carriage Return. For example, the MPS Tag for a New Line character is <\n> and the MPS Tag for a Carriage Return is <\#13>.
  4. In the Empty Link pop-up menu, select Delete. This will instruct DesignMerge to delete the variable link when it is empty. Since the variable link will be deleted, the variable link will not add the prefix (the Line Ending prefix will not be displayed in the document).
  5. If you would also like to remove the variable link's line if is empty when the variable link is deleted, select the Remove empty lines check box. This will instruct DesignMerge to remove each line the deleted variable link was on whenever there are no remaining visible characters on the line. This removes the Line Ending character that was at the end of the line that the variable link was on. 
  6. In the Type pop-up menu, confirm Text is selected and then select the appropriate Import Filter. For example, if you set up the variable link to add <\n> or <\#13> as a prefix, select MPS Tags. Below is an example of a variable link with these types of settings applied to it:
  7. When ready, click OK to apply these settings to the variable link and close the dialog. 
  8. Before continuing, open DesignMerge Preferences (DesignMerge > Preferences) and deselect the Smart Tags check box (shown below). Then, click OK to save this change to DesignMerge Preferences.
  9. In the document, use the Type tool to select both the Line Ending character that precedes the text for this variable link and also the text for this variable link. 
  10. Then, open the DesignMerge panel, select the appropriate DesignMerge panel settings for this text in the document, and click Assign or Replace (as shown below). This will place both the Line Ending character and the text inside the variable text. 
  11. Run a Data Preview merge session to confirm the following: 
           • When the variable link is not empty, the variable text will be prefixed with a Line Ending character.
           • When the variable link is empty, the variable text will not be prefixed with a Line Ending character and the variable text will be deleted from the page. Also, if you set up this variable link to remove empty lines, then the Line Ending character that was at the end of this variable text will also be removed.
For more information about setting up Variable Links, see Tutorial #1 (The Basics) in DesignMerge Documentation, available at Meadows Downloads.