View Single Post
Old 01-03-2019, 12:51 AM   #3
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by rjwse@aol.com View Post
I cannot understand the far-right panel "choose a location (anchor) in the file" nor how to set up in general.
Example. Let's say you want to create a link that jumps to a specific location in the book.

The way you achieve this is to give parts of your book a unique name. In HTML, this is called an "id" anchor.

Chapter02.xhtml:

Code:
<h2 id="HeadingCh2-2">This is Heading 2</h2>
This is the important information you need:
  • It's located in file Chapter02.xhtml
  • Has an id of HeadingCh2-2

Now let's say elsewhere in your book, you wanted to create a link that jumps to this location.

Code:
<p>This is a link to Chapter 2, Heading 2.</p>
First, you select whatever text you want to link:

Code:
<p>This is a link to Chapter 2, Heading 2.</p>
Then you push the Insert Hyperlink button (looks like a chain).

Now you want to tell it where to link to.

The Insert Hyperlink Screen

Click image for larger version

Name:	Calibre.Insert.Hyperlink.png
Views:	411
Size:	11.0 KB
ID:	168802

On the left-hand side, you have a list of Files. Select which one you want the link to jump to (in this case, Chapter02.xhtml).

(Optional) On the right-hand side, you'll see all the "id"s in that file. So it will display all "id"s located in Chapter02.xhtml. Like Kovid said, if no "id"s exist, this side can be completely blank.

Scroll down and select the one you want to jump to.

This will prepopulate all the bottom boxes for you.

After

Once you push OK, Calibre will convert your previous code

Code:
<p>This is a link to Chapter 2, Heading 2.</p>
into:

Quote:
<p>I want this to point to <a href="Chapter02.xhtml#HeadingCh2-2">Chapter 2, Heading 2</a>.</p>
This is an <a> tag. In HTML, <a> is used for links.

Now you can see all your important information located within the link:

Quote:
<p>I want this to point to <a href="Chapter02.xhtml#HeadingCh2-2">Chapter 2, Heading 2</a>.</p>
  • Red tells you the link will jump to Chapter02.xhtml.
    • This is what you selected in the left-side box.
  • (Optional) Blue tells you the link will jump to the id HeadingCh2-2.
    • This is what you selected in the right-side box.

Last edited by Tex2002ans; 01-03-2019 at 12:55 AM.
Tex2002ans is offline   Reply With Quote