Captions in references to figures

In the sample document, there is an example of a figure that is referenced in the text:

“As an example, here is an image from my website—Nautilus Star

As I understand it, the words inside the brackets function both as a name of the image; (also to be found in the image declaration [Nautilus Star]: Nautilus_Star “Nautilus Star” width=307px height=250px) and as text that is included in the formatted exported document:
“As an example, here is an image from my website—Nautilus Star (Figure 1).”

What do I do to get just the reference text “Figure 1” and not also the text “Nautilus Star” in the output?

To get “Figure #â€

Thanks for the hints! Only problem is that when I use the syntax you describe, I get the reference to the image as a footnote, where the footnote is the name of the pdf image I have referenced with a Scrivener link in the image declaration. Why do I get footnotes??

Is it possible in multimarkdown to specify different kinds of images, e.g. ‘Figures’ and ‘Examples’ so that they get separate caption number sequences?

The way to do it is the same way I use in the sample document (which I continue to highly recommend as a place to look for tips and tricks that don’t quite make it to the documentation).

You want to set up your reference to the image as a local link within the document, not as a URL. So instead of [][Figure], you would use . The automatic labels generated by MMD strip out leading digits, remove spaces, and convert everything to lower case (plus strip out a few other symbols that aren’t allowed in HTML id attributes.)

The sample document (including Scrivener source file, MMD text file, LaTeX file, PDF, HTML, RTF, and RTFD) can be found here:

In a word, no. It may be possible to do this within LaTeX(almost anything is possible in LaTeX), and then you could tweak MMD to look at the label given to the image and designate it as a Figure or Example, but this isn’t something I’ll be doing myself.

So the longer answer is not now, but you are welcome to try and add this feature.

The local link approach works beautifully for me when the destination is a LaTex document, but if I export to rtf or html, I end up with blank spaces where the links to figures should go.

Any ideas what I am doing wrong?



Send me an example that doesn’t work in HTML. The links won’t work in RTF, but I don’t believe it should be blank. But it might be a byproduct of the problem you are having with HTML.


Hi Fletcher,

Thanks for the quick response — and the powerful tool. I apologize if I am missing something fundamental. I am new to MMD, MD, and XSL, and I’ve been tinkering as well as reading documentation to try and sort out how it works, but it is likely that I have just made some incorrect assumptions along the way.

I’m trying to use MMD to reference figures in a way that will produce \autoref commands in LaTex, and still be readable in either HTML or RTF. If I use the internal reference syntax, and leave the first set of brackets empty, LaTex will create the \autoref that refers to the figure by its figure number, which is what I need. With the first brackets empty, however, html and rtf insert nothing for the link. If I put text in the first set of brackets, html and rtf happily show this text as a link, but then LaTex shows this text, and the \autoref right next to eachother. I hope I have explained this clearly. Below is a snippet showing some of the code that works beautifully in LaTex, but not so well in html. Thanks for any help.

Mean channel depth at the upstream site was 10 mm, versus 50 mm at the downstream site. Channel cross sections characterize the downstream site as a more deeply inundated plane, with higher local relief ().
[figureone]:double profile “Channel cross sections for (a)upstream site, and (b) downstream site”

All the best,

That’s why you have to look at the source code - MMD is doing exactly what you ask it to do. The relevant output in XHTML is:

with higher local relief (<a href="#figureone"></a>).</p>

Since you requested a link with no text inside the anchor, you got a link with no text inside the anchor. This makes the link invisible in XHTML and RTF, because the tag has nothing inside it.

If you change to some text here, you’ll see the now visible (but always present) link in XHTML and RTF.

That makes sense, and works for html, but not as well in latex. Here’s what happens:

This is what I have in Scrivener:

Here is the LaTeX produced:

And here is the typeset output:

Channel cross sections characterize the downstream site as a more deeply
inundated plane, with higher local relief (Figure 3.1). Now if I try it the other way figure 1 (Figure 3.1).

You can see how this approach yields a redundant output in Latex. I’m looking for a way to get the same MMD text to produce similar looking html and latex results, but I haven’t figured out how to do that with the existing XSLTs. I hope I’m not being terribly dense here.

Thanks again for your time and help.


I know that I can go in and edit either the Latex or html after exporting through MMD — it wouldn’t be that big of a chore. I just thought I might be missing the very obvious solution.

There’s not a good systematic way of allowing flexibility and providing identical results across formats.

XHTML and RTF do not provide a numbering scheme for figures, so you have to use something more descriptive.

If you don’t want your descriptive term to end up in the latex, you can always use a custom XSLT that doesn’t copy the term into the latex output.

Thanks again,
I’ll focus on trying to modify the XSLT to suit my needs.