Cross References

I am using Scrivener to write a rulebook - and as such, I am frequently referring to other sections of the text. Is there a way to have Scrivener automatically insert page numbers for those references when it compiles?

For example, I might have a section “Introduction” and it might refer to other sections like “Quick Start” or “Advanced Details”. I would like to have Scrivener maintain the locations of those sections and insert them when compiling, as below:

…for an overview of the process, see Quick Start on page [[quick_start::page]]

Furthermore, I intend to publish this in a number of formats including ebooks and PDF. Will regular Scrivener links become working hyperlinks in those documents when compiled?

Thank you for your help, Scrivener community!

PS - I wrote the original draft of my rules in markdown, imported that generated HTML to OpenOffice, and am now bringing my text into Scrivener to be reworked - so I’m thrilled that markdown support is coming to Scrivener for Windows! I can’t wait to get my text back into MD!

If you are already comfortable working in Markdown, then definitely go that route because right now that’s the only way to do cross-referencing. We do have plans for extending some minimal features for cross-refs for rich text workflows, but nothing too fancy. The flavour of Markdown that Scrivener uses is MultiMarkdown, which includes a very handy cross-ref technique. Basically whatever you call the section, so long as it has a title, it can be linked to using its name.

So for example, say you have a section called “Optimising for LCD Screens”, you could then refer to that section in any other portion of the text, like this:

Read [Optimising for LCD Screens][] for technical details.

Or, if you wish to use a natural language link instead of a named link:

Further instructions can be found in [the appendix][Optimising for LCD Screens] of this manual.

You don’t actually need to type in the “on page” part, because this precise method will be altered depending upon what is appropriate for the output. In HTML based formats, non-annotated hyperlinks will be used. In LaTeX, the above might look something like “Read Optimising for LCD Screens (Sub-section 23.8.2, pg. 532) for technical details.” (that part is up to your LaTeX stylesheet settings. I’m not sure what happens in ODT format; probably just uses a standard bookmark style link that can be styled with language like “see page XX”.

Thanks! I’ll be grabbing the beta tonight then, so I can get started returning to markdown.

Great! Just be aware that the beta right now has a few problems with MD syntax output. Titles, for instance, won’t be generated, but you can go ahead and assume they will be as that is a rather crucial part of the feature.

And can you confirm that this will work for ebook/kindle compile? in Windows
I have installed MMD, but not sure how to progress further. Need to read up on MMD

No this doesn’t work yet for either platform. The e-book output goes through the rich text engine, it handles the visible formatting of a document and converts it to the HTML required for e-books. It does not pass through the MMD engine. If there were an easy way of doing this right now, we’d have it. The problem is that MMD is not designed to easily produce many small documents. It’s designed to easily produce a document. E-books require many small documents and all of the details that come along with that apply, such as linking between them and so forth. It is something we’d like to either develop, or research a good method for, in the future. To my knowledge, no recent work has been done on such a thing, and the best route for making e-books in an MMD workflow is to export to HTML, and then dice it up yourself in a e-book editing tool like Sigil.

To clarify you can of course select one of the e-book options and compile your MMD project. Just note you will see raw syntax. That’s fine for proofing—and in fact I do that a lot myself. I like to proof on my Kindle so as to change up the reading environment as much as possible, and in that context I want to see the MMD codes because that is part of what I’m proofing.