What to Know Before Using Live Captions and Text Variables
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:
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.
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.
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.
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:
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>.
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:
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!
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.