help with cross references.

Hi there, I am having two problems with my cross references at the moment, if you can help with one or both, that would be great

  1. Multimarkup formatting codes is included when I cross reference a chapter. I want it to read “in chapter 4 I will develop…” - see the top red mark

when I reference a section, the number comes through fine. (see the red mark further down)

my chapter style looks like

scrivener 2.jpg

  1. I just get the title of the referenced document, not the number, When I the referenced document is not included in the compile. I want the number and not the title. (see both red marks below)

is there a way to get Scrivener to workout and include the correct cross referencing information, even if the referenced document is not included in the compile?

Thank you for your help.


Are you using Pandoc for compile, if so at least for your first reference, you are using block formatting ::: {custom-style=“Poetry”} ::: text ::: wrongly (it can’t be inline); you should be using inline formatting [text]{custom-style=“Poetry”}. If you can make a minimal Scrivener project that reproduces your problem it will be much easier to see what is going on…

Also, how can the cross referencing system know what to link to or what it is called if it is not included in a compilation? You should check what setting you have in Compile Pane “Document Title Links”, that allows you to replace the title with the numbered prefix (§10.1.4 and §24.8 of the user manual)

Thanks for your assistance,

Yes, doh, that’s obvious now, I can see why you need a document in the compile, before scrivener will know what to call cross references to it.

Also, you are quite right, If I wanted inline formatting, then I needed to use the inline syntax. But, that is not what I want. I just want the Scrivener just to pick out the chapter number from the prefix and add no further no other markup, As far as I can make out, based on your previous comments,Scrivener is picking up all the code before the chapter title, and using that for the cross reference, when I only want it it pick up the number from the prefix.

I have included a minimal scrivener project (Ziped) that replicates the problem.

minimal (858 KB)

thanks again for your help.

There are quite a few things that will stop any sort of structured output in that sample:

None of your headings are going to be useable for any markdown output:


::: {custom-style="Outline Chapter Title"} :::

Chapter One: # Introduction #

The octothorpe # is lost in the prefix, therefore pandoc/mmd cannot parse it as a title. Headings need to be on a line by themselves, with the octothorpe the first character. Also, custom styles will not be applied in this case (as the heading supercedes the custom block), you need to use another format for headings, or better yet just use the default heading styles.

Your compile settings don’t convert Scrivener links to multimarkdown, thus they will not be clickable.

Currently there is a bug in Scrivener that you will hit once you fix the other problems: — basically even if you remove all your styling the links will become:

... in Chapter [3](#3 Blue)...

Note the # which is not in the actual title. Scrivener will also copy markdown into the title, so for example you cannot use inline styles (currently you use STRONG for some of your title styles), as you end up with:

... in Chapter [3](#3 **Blue**)...

The asterisks will be removed by pandoc in the title, but not the link, causing links to break…

My general feeling is you are trying to do way too much with that Scrivener compile format, layering on section formatting prefix/suffix on top of paragraph and character styles. This produces invalid markdown, and I think there is no way Scrivener or Pandoc can cleanly resolve cross references…

thanks for your help. I really appreciate your time.

I have got it all working as I want. I simplified the Chapter style, right back to just the chapter title, and then only put the <$:chapter> placeholder in the title prefix.

the cross references work and the output look OK too.