Inserting Figures?

The templates for non-fiction describe how to reference a table or figure:

What I am missing is how do you insert a table or image give it a caption that will be automatically numbered.

I looked into the Scrivener-manual.scriv project assuming that I could figure it out from one of their captions.
No luck, since the manual is written using a mix of LaTeX and Scrivener and the figures seem to be done via LaTeX.

Does anyone know how to insert and caption a figure?

I think you just insert a figure and place the caption text below it using the RTF workflow. It is your job to then deal with the styling and trying to keep your figure captions linked to your figures if you use a Compile to another format like DOCX etc.

There is a much better way in Scrivener, but it involves using Multimarkdown. When you markup a figure with a caption in its own paragraph, compiling to most formats will get it converted into semantically correct figure+caption, so for example:

![!fig(outline) — This shows a graphical outline of the quest for truth.](scrivener_link_to_binder_image "Outline")

Would get converted to this in any HTML based formats:

<img src="/path/to/img.jpg" alt="Outline" />
<figcaption>Figure 1 — This shows a graphical outline of the quest for truth.</figcaption>

The output creates correct figure captions for [X]HTML[5] (and thus I assume any EPUB formats), DOCX, ODT, LaTeX and a few other outputs. For DOCX and ODT, the captions are properly given unique styles and wrapped in containing boxes so you have to do a lot less work after leaving Scrivener…

By the way, the !fig() markup is actually a replacement of the underlying Help > Placeholder Tags List… — look at Compile :arrow_right: Preset replacements to see the “raw” tags that are used.

I tried Multimarkdown, but could get compiled output for either eBook or PDF.

I did get “Figure: <$n:figure:NestedBinder> The Binder” to work as a caption and can use the same syntax to refer to the figure.

I started out with the novel template. The !fig(sales) stuff doesn’t seem to work in that template, but with the non-fiction template it does. Wonder what the difference is?

Here is the Preset Replacements panel of the non-fiction template, note the !(fig) shortcut syntax is really just replaced with the proper syntax:

There is only one “real” syntax for numbering: <$n:figure:myname> and one real syntax for referencing: <$n#figure:myname>. To use the useful shortcuts you would need to add them to your Project Replacements panel.

I don’t use EPUB, so I’m not the best person to help regarding the details of the compile. In general Multimarkdown / Pandoc offer a lot more flexibility in generating semantically correct output, irrespective of format. Because EPUB is really just HTML, and Markdown was born to create HTML, it is the route I’d use if I needed to generate an EPUB. But I’m the sort of person who fusses over semantic markup :stuck_out_tongue: