Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using text variables

From: Creating Long Documents with InDesign

Video: Using text variables

Any time you can take advantage of automation in a long document workflow, you should do so. One of InDesign's built-in long document features, text variables, can allow you to easily create things like running headers, chapter numbers and so forth, and while they do have some significant limitations, they are a useful tool, so let's see how they work. In this document I want to create a running header on the top of each left-hand body text page that reflects the chapter title. So right here, this text, I want to appear over here, at the top of each left-hand body text page, and for that I'm going to use a text variable.

Using text variables

Any time you can take advantage of automation in a long document workflow, you should do so. One of InDesign's built-in long document features, text variables, can allow you to easily create things like running headers, chapter numbers and so forth, and while they do have some significant limitations, they are a useful tool, so let's see how they work. In this document I want to create a running header on the top of each left-hand body text page that reflects the chapter title. So right here, this text, I want to appear over here, at the top of each left-hand body text page, and for that I'm going to use a text variable.

So I'll go to my Type menu and choose Text Variables > Define. And in the dialog box I see a list of all the different kind of text variables InDesign has, so chapter numbers, the date the file was created, the file name, the last page number of the file, the last time the file was modified, when it was output, and the running headers. So I'll click on New to create a new text variable, and I'll call it ChapterTitle. It's going to be a running header based on a paragraph style and that style is ChapterTitle, and I'm going to select First Use on Page and leave all the other options off and click OK.

I'll click Done and then click in my text frame. And now I do insert the variable, I go back to the Type menu and choose Text Variables > Insert Variable > ChapterTitle, and I'll zoom in so I can see it. And there I have it, I picked up all the text styled in that chapter title paragraph style, so Chapter 2 The Big Cheese. But what if I didn't want all the text that was styled in a paragraph style for my running header? Like what if I just wanted the words, The Big Cheese and I didn't want Chapter 2? Well, that is a case for a character style text variable.

So the first thing to do in this instance I'll zoom out and go back to that chapter opener page, where I have the text that I want to appear in my text variable, and I'll go to my Character Styles panel and create a new character style. I'll hold down Option or Alt and click on the New Style button, and this one I'll just call runningheader. And that's all I'm going to do in this dialog box. I don't want to turn on any kind of formatting options, because I don't want to change the look here. I just want a basically tag this text, so it can be used in a text variable.

So I'll click OK, and then select the text I want to appear in my running header, The Big Cheese, and apply the Character Style, runningheader. Now I can go down to the page where I want the runningheader to appear, I'll zoom in and I'll delete that old text variable I didn't want, and I'll create the new one. So I'll go back to Type > Text Variables > Define. I'll click on New and from the Type menu I'll pick Running Header (Character Style) for the Style I'll pick my new runningheader character style and click OK.

And now because I left my cursor in the text frame, I can click on Insert, and Done. And now I can see I just have the words The Big Cheese without Chapter 2 in them. So now that we've seen what we can do with text variables, it's time to talk a little bit about what you can't do with them. First of all you can't predefine formatting for your text variables; they just take on the formatting that was active at that spot in the text frame where they were inserted. Once in the text frame, You can select the text variable and then change the formatting up in the Control panel or the Paragraph Styles panel, but it's an all or nothing kind of formatting.

You can't get your cursor inside a text veritable to select just part of it, this is one the Achilles' heels of text variables. So, for example, if you're referencing the title of a book in a text variable, You can italicize that book title separately from the rest of the variable text, which is unfortunate. In addition to the limitations on formatting, there's another big problem with text variables, and that is variable text will never wrap or break across lines. So if I take my Selection tool and decrease the width of this text frame. You'll see the text variable start to accordion in on itself.

It just becomes compressed horizontally until it's completely unreadable, and it doesn't matter how tall I make the text frame, it's never going to wrap to another line. So what do you do in this instance? Well, one option is to convert the variable to regular text. So to do this you can select the text variable and go to the Type menu and choose Text Variables > Convert Variable to Text. Now it's just regular text and you can do anything you could do to normal text, whether you can select it and apply any other kind of formatting. So nested styles, character styles, GREP styles, anything goes here.

But in exchange for that flexibility, you've given up the dynamic nature of this variable, so it's not going to respond to changes in that source text. If the chapter title changes from The Big Cheese to something else, this running headers is not going to change anymore. So if you are going to convert text variables to regular text, make sure it's one of the last things you do in the workflow, so you don't end up regretting it later, if changes make your former text variables start showing the wrong stuff. If these limitations are causing you serious time-consuming or money-consuming problems, consider checking out a product called Power Headers that in-tools.com as an alternative.

Power Headers can create running headers that are live text with all the formatting options of normal text, and many options for choosing the source text. Let's take a quick look. So I've installed Power Headers here, and I have an InTools menu, and a Power Headers choice and I'll choose Define Header Variables, and click on New, just to look at the options I have. First of all I can combine character styles and paragraph styles from my source text, so I can just find specific uses of character styles within a paragraph style. I can define alternate styles as well, so I can have many styles contribute to my running header.

I can have a different source range, so not just a page, but a spread or specific column. For the Type, I have First Instance, Last Instance or every instance of a usage of a style, or many other options as well. And I can also Copy Local Formatting into my running header. So if I had nested styles or character styles applied, those can appear my running header as well. So Power Headers by In-Tools with lots of options for creating running headers that you can't do with a normal InDesign text variable.

So while InDesign's text variables aren't especially flexible, they do fill an essential need for a little bit of automation when it comes to creating things like running headers and footers.

Show transcript

This video is part of

Image for Creating Long Documents with InDesign
Creating Long Documents with InDesign

59 video lessons · 15538 viewers

Mike Rankin
Author

 
Expand all | Collapse all
  1. 10m 48s
    1. Welcome
      54s
    2. Using the exercise files and scripts
      1m 51s
    3. Long-document workflow overview
      4m 20s
    4. Analyzing the planned output
      3m 43s
  2. 34m 7s
    1. Using master pages
      9m 34s
    2. Using layers
      7m 23s
    3. Using text variables
      6m 42s
    4. Using section markers
      5m 44s
    5. Synchronizing text
      4m 44s
  3. 26m 16s
    1. Using InDesign templates
      7m 10s
    2. Setting up preferences
      3m 27s
    3. Using Word templates
      5m 50s
    4. InCopy workflows
      5m 17s
    5. Creating a production manual
      4m 32s
  4. 40m 2s
    1. Using Based On styles
      6m 14s
    2. Using nested styles
      5m 56s
    3. Using Next Style
      3m 39s
    4. Using GREP styles
      6m 17s
    5. Using object styles
      2m 48s
    6. Using table and cell styles
      5m 8s
    7. Using swatches
      5m 33s
    8. Using Quick Apply
      4m 27s
  5. 37m 57s
    1. Placing text
      4m 57s
    2. Placing images
      3m 41s
    3. Creating metadata captions
      4m 3s
    4. Using Mini Bridge
      4m 38s
    5. Using libraries and snippets
      6m 4s
    6. Using GREP Find/Change
      5m 5s
    7. Find/Change tips
      5m 21s
    8. Using Layout Adjustment
      4m 8s
  6. 15m 53s
    1. Using Notes
      4m 7s
    2. Tracking changes
      4m 36s
    3. Using CS Review
      7m 10s
  7. 34m 43s
    1. Creating tables of contents
      7m 9s
    2. Alternative uses for the TOC feature
      4m 9s
    3. Creating cross-references
      6m 8s
    4. Creating footnotes
      6m 31s
    5. Importing footnotes
      6m 47s
    6. Creating endnotes
      3m 59s
  8. 33m 50s
    1. Scoping out the index
      2m 19s
    2. Creating index topics and references
      9m 29s
    3. Creating index cross-references
      3m 1s
    4. Creating index references with Find/Change
      3m 31s
    5. Generating an index
      3m 35s
    6. Preserving formatting in an index
      5m 13s
    7. Using third-party indexing tools
      6m 42s
  9. 26m 44s
    1. Using InDesign book files
      4m 37s
    2. Numbering book documents
      5m 46s
    3. Synchronizing book documents
      7m 5s
    4. Preflighting book documents
      3m 49s
    5. Outputting book documents
      5m 27s
  10. 12m 54s
    1. Using conditional text
      5m 1s
    2. Using Smart Text Reflow
      4m 3s
    3. Using object styles for customization
      3m 50s
  11. 25m 17s
    1. Preflighting documents
      6m 56s
    2. Exporting to print PDF
      5m 26s
    3. Exporting to interactive PDF
      5m 36s
    4. Archiving a project
      7m 19s
  12. 48s
    1. Goodbye
      48s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Creating Long Documents with InDesign.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.