In ebooks, you can make a piece of text link to a picture somewhere else in the book.
Let's say you have a line in your book like this:
You can see an example of this in the picture of palm trees we showed you in Chapter 8.
...you could make the words "the picture of palm trees" be a link to the picture in your ebook.
In the ebook, people would see "the picture of palm trees" was formatted differently from the text around it, and know that they can click on it to go to another part of the ebook.
In this article, we're going to show you how you can create crosslinks to images in your Leanpub ebook!
Related Article: How can I create crosslinks in my book?
Creating an "Anchor"
Before you can point a link to something, you need to have something to point the link to!
The thing you point the link to is called an "anchor". You need to type the anchor in your book manuscript, but no one who reads the book will see the anchor.
Here's a normal image inserted into a Leanpub book manuscript:
![](palm-trees.jpg)
Here's the same image, but with an "anchor" attached to it:
{#palmtrees}
![](palm-trees.jpg)The anchor in this example is:
The anchor in this example is:
{#palmtrees}
The anchor can actually be (almost!) anything you want, as long as it starts with a # and is surrounded by { and }.
Lowercase letters, numbers, hyphens, and underscores are valid characters for the identifier. (Thanks to Leanpub author Marc Bless for helping us correct this article!)
So, you could also do this:
{#palmtreespic}
![](palm-trees.jpg)
Creating a Link to an "Anchor"
To create a link to an anchor, you surround the word or words you want to turn into a link with [ and ], and then you attach the anchor to that, between ( and ).
That may seem a little technical at first, but it will be second nature after a while!
Let's start with the example line from the beginning of this article:
You can see an example of this in the picture of palm trees we showed you in Chapter 8.
To make "the picture of palm trees" into a link, we do this:
You can see an example of this in [the picture of palm trees](#palmtrees) we showed you in Chapter 8.
The link in this example is:
[the picture of palm trees](#palmtrees)
In the ebook, "the picture of palm trees" will be formatted as a clickable link.
Here's what it will typically look like in the ebook:
OK, that's it!
If you have any feedback or questions about this article, please email the Leanpub team about it at hello@leanpub.com!
If you have any questions or thoughts on writing and self-publishing with Leanpub, please join our global community of authors in our Authors Forum here!
Are you interested in self-publishing, and creating your first Leanpub book? Here are some quick tutorials for our most popular writing modes: http://help.leanpub.com/en/articles/3088382-quick-walkthroughs-for-getting-started-on-a-leanpub-book
Are you looking for great deals on Leanpub ebooks, ebook bundles, and courses? Sign up for our Weekly and Monthly newsletter sales here!
Subscribe to our YouTube channel here: https://www.youtube.com/leanpub
Please subscribe to our YouTube channel here: https://www.youtube.com/leanpub
You can also follow Leanpub in lots of other places!