is now part of CreativePro.com!

What to Know Before Using Live Captions and Text Variables

9 11

Text variables and live captions give you a way to make certain content in your InDesign documents dynamic. They can be used to create things like running headers in long documents and captions to go with images. Text variables were introduced into InDesign in CS3, and live captions were added a couple of versions later in CS5.

I like using both text variables and live captions, but it is important to understand their limitations before using them in a project. Here are some things that can cause you trouble.

Text variables do not break over lines

All of the text in a text variable is treated like a single character, so it cannot break to another line. This is best demonstrated using a live caption. In the following example, the information about the sculpture in the photo has been entered in the Description field of the image metadata in Bridge. When used in a live caption, this is what you get:

caption01

There is no way to make a text variable break over two lines without converting the variable to text (choose Type > Text Variables > Convert Variable to Text). Doing so will allow the text to break over more than one line, but sacrifices the link to the information in the caption. So if the description in the image changes, you’ll have to update it manually in the InDesign file.

More after the jump! Continue reading below
Free and Premium members see fewer ads! Sign up and log-in today.

This is a particular problem for captions since they often run longer than one line. If you’re working with a project with plenty of images and captions, you’ll soon become aware of this limitation.

To be fair, Adobe acknowledges this in its help pages for text variables and live captions.

caption02

So this isn’t a bug, instead this is just how text variables have always behaved.

Formatting applies to the entire text variable

Another major problem with text variables involves formatting. To deal with the no-break limitation of live captions, I’ve shortened the caption shown below so that it will fit without being compressed. But now I would like the title of the sculpture to be italic up until the comma, and then the rest of the sentence set in a regular font. I would normally do this with a nested style or a GREP style, but when I apply one of those to the text, all of the text in the caption becomes italic rather than just the text up to the comma.

caption03

As before, if I convert the caption to static text, the problem goes away. But again, this breaks the link to the information in the image file.

Put simply, portions of a text variable can’t be formatted with GREP styles or nested styles; and specific words or letters within a text variable can’t be formatted on their own – formatting always applies to the entire text variable.

Now that we’ve seen some known limitations, let’s look at a couple true bugs to watch out for.

Bug 1: Two or more text variables used in a Table of Contents

In the example below, I’ve amended the caption so that it contains two text variables: the description of the image, and the author of the image, as well as the words “Photo ©” between the text variables. I would like to make a list of all of the photographs used in the book, and to do this I’ll use InDesign’s table of contents feature to grab the text formatted with the caption paragraph style. However, once the table of contents is created, the result is rather alarming:

caption04

Once more, if you convert the text variables to static text and update the TOC, then everything will appear correctly, but again the links to the information in the images will be lost. Sensing a theme here?

InDesign scripter Marijan Tompa (aka Tomaxxi) has a script called convertVariable2text that will conveniently convert specified text variables to static text. If you have many variables to convert to static text, this script is certainly worth using.

Converting variables to static text resolves most issues except for the following bug.

Bug 2: <No data from link> despite the information present in the metadata

The following screenshot shows the same placed image with different text variables at the end of the caption – the one on the left uses “Author”, the one on the right uses “Creator”. In Bridge, both Author and Creator are my name, yet in the InDesign file, the “Creator” caption is showing as <No data from link>.

caption05

In an attempt to fix this, I’ve opened the image in Photoshop and just saved it as a Photoshop file. I’ve relinked the images, and while the left caption is correct, the right caption now says something completely unexpected:

caption06

A look at Bridge shows that the Creator is still my name, but one addition has been made to the metadata: a field titled Application… but that isn’t the Creator metadata field that InDesign should be referencing in this caption, so something is not right here.

Here is an even more baffling example. A JPG digital photo (yet to be manipulated with Photoshop) is placed into InDesign and given a caption via the “Camera” metadata field. And the model is correctly displayed in the caption. So far so good.

But if you take this image into Photoshop and simply save it with a different name (still as a JPG) and place that new image into InDesign with the same caption, <No data from link> is displayed instead. If you check the image in Adobe Bridge, you can see the camera information is still present. Now if you save this image as a PSD, and place it into InDesign the caption will be correct. But if you go back to Photoshop and save it as a JPG with a different name, <No data from link> comes back! How frustrating!

caption07

This bug appears to specifically affect camera information. As demonstrated in the last example, saving images as Photoshop files does help to retain the camera information.

Bottom line: before you start creating layouts where you plan to use live captions, it is a good idea to save your images in a consistent file format that will preserve all of the metadata used for live captions, and confirm everything is working as expected with a few test files.

A prepress operator and graphic designer for a South Australian commercial printer, with close to 20 years of experience in the trade. He is also a regular contributor to this site and InDesign Magazine, and hosts his own prepress blog "Colecandoo".
  • David says:

    We encountered bug no. 1 recently while working on a publication and doing the exact same thing–trying to create photo credits displaying the Credit and Country metadata fields. Annoying that one of the most useful applications for the Text Variables feature doesn’t behave without a workaround. Also encountered another issue with TOC styles when the targeted paragraph styles are in a style group. InDesign kept crashing while trying to generate the TOC. The most expedient resolution is to avoid using style groups if a paragraph style is going to be used in TOC styles.

  • Lukas Engqvist says:

    Encountered the creator bug when demoing, and was very frustrated. Thanks for this Will share it with My students.

  • Kelly Vaughn says:

    Great article Colin. Text variables often misbehave and it’s so frustrating… I have a couple of examples of misbehaving variable as well: mine have to do with file name extensions and page numbers displaying incorrectly in the PDF. Perhaps these will be useful to others: https://documentgeek.blogspot.com/2012/05/what-to-do-when-indesign-variables-dont.html

    • I’ve noticed these behaviours/bugs also affect another live feature – the inserting of the special character marker “section”.

      I’ve also tried with cross references, but found that cross references could be over one line, but had problems trying to get two different character styles… until I looked at Adobe’s help website, and there is far more control over the appearance of cross references through the cross references dialog box… but read the help page! https://helpx.adobe.com/indesign/using/cross-references.html

  • Angie says:

    Great article. As annoying as text variables can be, they are huge time savers. It’s important to define them properly and always to keep in mind that they are not really text, but a symbol used to represent the text that will appear in that place. That takes some of the frustration away from not being able to individually style certain words.

  • **UPDATE** Adobe has acknowledged the report and “escalated” the issue. https://forums.adobe.com/thread/1720336 (third post down, Monica Singh).

  • Manan Joshi says:

    I have created a solution for the wrapping issue of live captions and also the alignment issue of caption box

    More details on TruLive Captions can be found at https://github.com/Manan-Joshi/TruLive-Caption

  • mike morakis says:

    Hello is there any way I can change the name of a month in the variable modification date? In english is correct but when I set the language to greek it translates “Ιανουαρίου” instead of “Ιανουάριος”. I guess there should be a list where all months are translated.

  • >