Warning: Constant MULTISITE already defined in /home/pbmalartu/public_html/wp-config.php on line 107

Warning: Constant SUBDOMAIN_INSTALL already defined in /home/pbmalartu/public_html/wp-config.php on line 108

Warning: Constant DOMAIN_CURRENT_SITE already defined in /home/pbmalartu/public_html/wp-config.php on line 109

Warning: Constant PATH_CURRENT_SITE already defined in /home/pbmalartu/public_html/wp-config.php on line 110

Warning: Constant SITE_ID_CURRENT_SITE already defined in /home/pbmalartu/public_html/wp-config.php on line 111

Warning: Constant BLOG_ID_CURRENT_SITE already defined in /home/pbmalartu/public_html/wp-config.php on line 112

Warning: The magic method Pressbooks\Book::__wakeup() must have public visibility in /home/pbmalartu/public_html/wp-content/plugins/pressbooks/inc/class-book.php on line 62
Adding Hyperlinks, Internal and External – Pressbooks User Guide ="http://www.w3.org/2000/svg" viewBox="0 0 512 512">

Making Your Book Look Good

Adding Hyperlinks, Internal and External

In this chapter we’ll show you how to add:
a) External links to web pages
b) Internal links within the book

External Links

You can add a link to any external website using the VISUAL EDITOR, or the TEXT editor.

Visual Editor

Here is how you add a link in the visual editor:

  • Write some text
  • Highlight the text
  • Click on the “Link” icon in the toolbar
  • Add your link

See:

Adding an external link

Adding an external link

TEXT Editor

Using the TEXT editor, the format should be:

This <a href="http://somesite.com">text has a link</a> and then goes on.

Internal Links (Links Within Your Book)

You can also link within your book, for instance from one chapter to another. The difference when you are linking internally, rather than to a web page as you might be used to, is you don’t have a URL in the traditional sense. Instead, you need to use the identifier (called a slug) of an internal location, of which there can be two kinds: default locations and locations that you create yourself. Both of these are used to indicate an exact point in your document. Here’s how you do it:

Default Internal Links

When you create a document, there are already some identifiers that it will understand. For example, if you want to link to a chapter, you simply need to enter:

/chapter/[your-chapter-title-here]

To link to a part, enter:

/part/[your-part-title-here]

To link to a front matter section, enter:

/front-matter/[your-section-title-here]

To link to a back matter section, enter:

/back-matter/[your-section-title-here]

The easiest way to find this location identifier is to look at the URL of a page in the web version of your book, if the chapter has been published, and copy everything that comes after .com (including the forward slash). 

nav2

If the chapter is still in draft, just look at the permalink below the chapter title and copy everything that comes after .com (including the forward slash). 

Internal Links with Permalink

Create Custom Internal Links

In order to create links between more than just chapters or parts, you can create custom location tags that you can then link to from anywhere in your book.

Let’s say you’re writing a section of your book, and want to link to a list of terminology that you have written in an earlier chapter, named “Program Overview”.

  1. Go to the “Program Overview” chapter
  2. Find the “Terminology” section heading
  3. Place your cursor at the start of the heading and click on the “Anchor” button on the toolbar (it looks like a small flag, bottom row, fourth in from the left)
  4. Enter a name when prompted (this must be unique).
  5. You now have an anchor tag the start of your heading, and should see it appear as a small icon.

To link to it, go back to your chapter in progress, and follow the instructions above to create a link. When it prompts you to enter a URL, enter:

/chapter/program-overview/#terminology

This indicates that the link is to go to a chapter named “Program Overview” and find the anchor tag called “terminology“.

Uses:

  • Link to figures from main body text and vice versa, eg. See Figure 1 (NOTE: to add an anchor tag to an image caption, you must add it manually in the image editing window, not the visual editor. Simply enter the caption as <a id=”[your-id]”></a>[Your Caption]).
  • Link to chapter sub-sections.
  • Link to specific sections of back matter.
  • Link between chapter sections and their related exercises.

License

Share This Book

css.php