is now part of CreativePro.com!

Understanding InDesign’s Hyperlink Formatting

11 0

Hyperlinks are probably the most fundamental interactive feature you can build into your InDesign documents. In fact, they’re just about the only interactive feature that works across every kind of interactive document you can export from InDesign, including EPUBs (fixed-layout and reflowable), PDF, DPS (old and new), HTML, and SWF. So with all these hyperlinks to deal with, it’s worth understanding how InDesign handles the formatting of hyperlinks to save yourself some aggravation.

The Hyperlink Character Style and Swatch

Since InDesign CC, a new character style called Hyperlink is created the moment you add the first hyperlink in a document. Strangely, this is true even if you choose not to use the style, and even if the hyperlink is applied to an object and not to text. By default, the Hyperlink character style applies just a blue color and an underline.

20151112-hyperlink7

A new blue swatch used by the character style (and also called Hyperlink) is created as well.

20151112-hyperlink2

There is no way to turn off the automatic creation of the character style and swatch, but you are free to edit them or delete them and replace them with another style and swatch.

Setting Default Hyperlink Formatting

In the New Hyperlink dialog box, there is a menu where you can choose to apply the Hyperlink style, another style, or no style to your new hyperlink. You can also create a new character style to use.

20151112-hyperlink3

The choice you make here is “sticky” meaning that it will apply to all new hyperlinks you create in the document, until you change it in this dialog box (or delete the style and replace it with another or [None]). It will even apply across documents, if you choose any style that exists in both documents, [None], or [Same style].

Changing the formatting of an existing hyperlink won’t affect the formatting that gets applied to new hyperlinks—even if you use the Edit Hyperlink dialog box, which looks identical to the New Hyperlink dialog box.

20151112-hyperlink4

And if you manually remove the character style applied to an existing hyperlink using the Control panel, the style will still be applied to the next hyperlink you make. Sticky indeed.

One Style Fits All…Except When It Doesn’t

The chosen character style applies itself to all types of new hyperlinks. This is unfortunate because it would be cool if, say, InDesign could remember that you always wanted hyperlinks to text anchors to be formatted with a different style than URLs. Alas, this is not the case.

On the other hand, hyperlinks that you wish would have consistent formatting may not. For example, there’s nothing to prevent shared destinations from having different styles applied to them.

Deleting a Hyperlink Doesn’t Delete Its Formatting

Also, if you decide to remove a hyperlink, the formatting stays, which can lead someone to think there’s a hyperlink where there isn’t.

20151112-hyperlink5

GREP Style Formatting is Overridden

You might think you could compensate for a lot of these quirks by creating a GREP style to override the formatting from the hyperlink dialog boxes. And you can—but only if you choose [None] or [Same style] in the hyperlink dialog box.

20151112-hyperlink10

Otherwise, the GREP style formatting will be overridden by the formatting from the chosen hyperlink style. For example, in the screenshot below, a GREP style made both URLs green until the second one was converted to a hyperlink.

20151112-hyperlink9

Formatting Via Convert URLs to Hyperlinks

One other point worth mentioning is that the Convert URLs to Hyperlinks feature, while somewhat primitive (it thinks any text without spaces around a period is a URL), it does give you the ability to create new hyperlinks at the document or story level, and apply different character styles as you go, like a Find/Change.

20151112-hyperlink6

So while there’s definitely room for improvement in the way InDesign handles hyperlink formatting, at least now you know where that Hyperlink style and swatch came from, and how to avoid them if you want to.

Editor in Chief of CreativePro and InDesign Magazine. Instructor at LinkedIn Learning with courses on InDesign, Illustrator, GIMP, Inkscape, and Affinity Publisher.
  • Helpful post, Mike! It reminded me of this other helpful article you wrote about which style overrides which: https://creativepro.com/when-character-styles-collide.php

  • Inkling says:

    Quote: One other point worth mentioning is that the Convert URLs to Hyperlinks feature, while somewhat primitive (it thinks any text without spaces around a period is a URL)

    Ah, you’ve touched on one of my top wishes for ID, making it URL-savvy. If only it knew with absolutely certainty what is or is not a URL. There’s a host of GREP scripts that try to do that, but I have yet to find one that doesn’t miss some of the time.

    Of particular importance would be a way to tell search and replace to ignore all URLs. When I format books for publication, I often must convert hyphens to En or Em dashes, typically En dashes. The endnotes for today’s scientific books include a host of URLs, hundreds of them, and many are filled with hyphens that absolutely must not become En dashes. But at the same time, those same endnotes also have hundreds of page ranges that absolutely must become En dashes. It’s mind-numbing labor that would be far easier if the ID’s search and replace window allowed URLs to be included or excluded from searches.

  • Eugene Tyson says:

    Simplest solution – set URLs to No Language.

    Type>Hyperlinks&Cross References>Convert URLs to Hyperlink.

    Even allows you to choose a character style – from the Character Style create one that has language set to No Language.

    Now when you do Find/Replace make sure you select the Language as an option – this way only the text assigned a Language can be changed – and no language is ignored.

    Hope that makes sense. Or am I talking a load non-sense?

    • Inkling says:

      You’re making great sense Eugene. I’ve seen people mention setting No Language as a way to keep links from being treated as misspelled words. This should work for that too.

      When I do the layout, I do mark hyperlinks as such, so that would work. But technically, since this is the print-only version of the book, that markup isn’t necessary. A company in India with some very hard-working people creates the digital versions for both epub and Kindle. The publisher has yet to adopt my ID copy for the epub version. Maybe I should suggest they consider that.

      I hope there are developers at Adobe working on making ID completely html savvy without these patches and hand work-aroungs. It’s be great if everything that needs to be done with a link would be automatic.

      1. No spell checking
      2. Either no hyphenation or smart hyphenation (no hyphens inserted, breaks at appropriate places)
      3. Auto-tagging as HTML.
      4. Options to search or not search hyperlinks.

      ID already has a most nice feature, automatically checking those links for validity. This would round out the feature set. It’d also work well with the new Publish Online feature.

  • Frederick Yocum says:

    This shift to automatic hypherlinks has been fairly teethgrinding. Thanks for pointing it out that it isn’t just me.

    I find that I almost always need to edit the hypherlink in supplied text (getting rid of the extraneous https:// or www or trailing / etc.). Usually documents have hypherlinks in a number of different kinds of text — main body text, sidebars, calls to actions — all of which have different paragraph styles and therefore different character hypherlink styles. The new functionality just made things more difficult, because I need to look out for a renegade character style and colour that keep appearing if I am not careful.

    Adobe We need a preference to turn off automatic hypherlink styling.

    • Inkling says:

      I don’t know about now, but a year or so ago when I looked for a GREP search that’d reliably find web links I drew a blank. Given how powerful GREP is at locating patterns, I suspect the reason wasn’t due to those writing the scripts. It’s just that parsing out what is a web address and what isn’t must be dreadfully hard, particularly locating where it ends.

      It’s also an interesting illustration of what often happens. We humans are far better at pattern matching than our machines. Finding and tagging all of a web address may be tedious for us, but it’s not something we make mistakes about.

      Sometimes the best search is a machine-made one that’s augmented with human choices. Let the search find and make a guess as to what constitutes a web address and offer that, properly highlighted to us. We then get to accept that, reject it, or tell the software that it has come up short and needs to extend the selection.

      That’s how I solved the problem of a book with many hundreds of wrongly formatted endnotes converted to mere text because ID doesn’t do endnotes. I contrived a GREP search that found any string of numbers followed by a space and gave me the option of doing nothing or replacing it with that same string of numbers followed by a period and a space. It was tedious, a lot of endnotes had page references that met that same criteria, but infinitely better than doing the whole thing by hand.

      The hitches with these sorts of handy time savings are:

      1. ID’s dreadfully dangerous search and replace window. It’s all too easy to click on Replace All when you meant something different. The buttons need to be rearranges so the oft-used and safe ones are close together and Replace All off by itself.

      2. No ‘find my last change’ option. It’s great that ID now allows users to search backwards. When I get numbed by the tedium of replace or not and make a wrong choice by not changing and then realizing my mistake, a backward search brings me back to that term. But if I make the change when I shouldn’t there’s often no way to return. A ‘return-to-previous find’ option would come in handy there.

      3. No multiple replace options. Drafts of books often use a simple hyphen for everything. Choosing between hyphens and one other dash is easy. Skipping leaves the hyphen in place and replacing will turn it to either an N-dash or an M-dash. There’s no way to do either of the latter two changes although. It does seem that allowing two possible replaces wouldn’t be that hard. It would just be the same code repeated twice.

      That said, one reason I prefer ID over all the other options is the power it has, if properly used, to make book-wide changes easily. How many other apps not only have GREP built-in but are able to deal with their own internal formatting as well as GREP’s standard alphanumeric characters?

  • Linda says:

    It would be nice to be able to turn off the feature for applying the Hyperlink character style to hyperlinks automatically. We do quite a few publications for the legal community. The problem is that the hyperlinks can be roman, italic, bold and bolditalic. This new feature actually causes a problem for our purposes and costs us more time to complete the projects.

  • Susan says:

    In a Newsletter I laid out in InDesign two ENTIRE PAGES were converted to hyperlinks. These are pages that had other hyperlinks on them. How did I do this and how can I undo it? Please help!

    • Lindsey Thomas Martin says:

      Susan, to remove, select the text affected, go to the Hyperlinks panel > submenu > Delete Hyperlink. How it happened is difficult to say without seeing the document and knowing what actions you took before the hyperlinks appeared.

  • Rombout Versluijs says:

    Does anyone have an understandable explanation for “Shared Hyperlink Destinations”? I really dont understand the Adobe explanation and doesnt really tell the difference between shared and none shared?

  • >