Mellel's Blog
Cross References in Mellel

Cross References in Mellel

A new and wonderful video is here — all you need to know about Cross References (except that you’ll discover so much more. You can view it using the link below:

Following is a transcript of the video:


Hi and welcome to a Mellel Quick tutorial. Today I’m going to show you Mellel’s cross reference feature, which is both powerful and easy to use.

What is a Cross-Reference

Before we start it might be a good idea to explain what cross references are. A cross reference is a link between two locations in a document. For example, if you mention something briefly at one point in your book, you could use a cross reference to point the reader  to another chapter or section where this is discussed at length, usually in the form of “See page so-and-so for more details”

Bookmarks & References

For example, let’s see how to create a simple cross-reference. Before making a reference, we need something to refer to, a target. The simplest way to create a target is using a bookmark.

Place the insertion point at the desired target location and choose Insert->Cross Reference->Insert Bookmark. Give your bookmark a meaningful name, and click outside the popover to dismiss it.

Now that we have something to refer to, we can insert a reference. Place the insertion point where you want the reference to be and choose Insert->Cross Reference->Insert Reference.

In the Edit Reference dialog, select the name of the target bookmark in the existing targets list and click OK. The inserted reference is the page number of the taget which is updated if and when the target moves. The reference is also highlighted on screen to help you easily spot your references, the highlight is not displayed in print or when exporting to PDF.

Referencing Auto-titles

Using a bookmark as the target of a reference is great when the target is at some arbitrary location in the text but if your target is some part of the structure of the document like a chapter or a sub-chapter, there’s no need to insert a bookmark and you can create a reference to your Auto-title directly. Place the insertion point where you want your reference, and choose Insert->Cross Reference->Insert Reference, click on “Auto-titles” in the target type list and choose your target from the list. Note that can use the filter field to locate your target quickly. Click “OK” and there you have it.

Changing the reference format

So far the references we’ve created showed the target page number, but what happens when you  want to include more details about the target? For example, here’s a reference to a chapter in our book. The page number is prefixed by the chapter name, but unlike the page number which will update when the target moves, the chapter name here will not be updated if the chapter’s name changes, since it is just text that we typed. To fix this, let’s remove the chapter name typed in the text, and then double-click the reference. The bottom part of this dialog displays the reference format. As you can see, at the moment the format only includes the page number. Place the insertion point before the page number element and choose “auto-title title” from the Insert Element popup menu, now let’s also type some text to connect the two and press “OK”. Now our reference includes both the page number and the chapter name.

Conditional Page Numbers

Using a page number to refer to something that is 30 pages away in the document is great, but sometimes our references are quite close to their targets, and it would be much nicer if we could refer to something as being on the next page or above or below our reference. Using a conditional page number format we can achieve just that.

Let’s edit this reference to have a conditional page number format. Double-click the reference to edit it. The format says “see <autotitlte title> on page <page number>”, let’s remove “on page” since this part will change dynamically, depending on the relative position of the target. Now, double-click the page number element to open the page number format dialog.

At the top we see the default format which is now just the page number, let’s keep the page number but add “on page” before that.

The rest of the dialog gives us the option to choose in which cases we’ll use a different format for page numbers. Let’s check the “On the next page” checkbox and enter “on the next page”. Let’s also check “On the previous page” and enter, “on the previous page”. We can fill additional fields, but for now these two will suffice. Press “OK” to finish editing the page number format, and press “OK” again to dismiss the Edit Reference dialog.

Looking at the reference it looks as if nothing has changed. This is because the reference target is quite far away and certainly not on the next or previous page so Mellel is using the default page number format for these which is “on page so-and-so”. Let’s change this reference target to see how this effects the reference.

Double click the reference, and now let’s choose a different target which I happen to know is on the next page. Press OK to finish editing the reference and there you have it, the reference now says “on the next page”.

Export to PDF

References are, of course exported to PDF and serve as links inside the document. Choose File->Export->PDF, choose a location and click “Save”. Now let’s open the PDF. Hovering over a reference changes the cursor icon to a hand and when we click the reference, the target is scrolled into view.

That’s it for this Quick Tutorial. Thanks for watching, and we’ll see you next time.


All rights reserved to Mellel, 2002-2020.