Markdown table captions - unexplained output

Hi,

(MacOS 14.2.1, Scriv 3.3.6)

I’m trying to follow the instructions in the manual to compile to plain Markdown output from standard Scrivener ‘RTF’ editing. (i.e. There is no native markdown in the project: everything is converted on compile.)

It all works very well, with the exception of table captions, which are simply passed through as ordinary text.

The table in Fig 21.5 shows what should happen:

I.e. The source captions is converted to be enclosed in square brackets (in the red box above) to be picked up by the Markdown engine as a caption.

However, this table in a newly created project:

… renders the table perfectly, but leaves the caption as plain text – note the absence of square brackets around the markdown.

This was compiled with the default MultiMarkdown compilation target with these settings.

I have tried this both with and without a separate ‘Caption’ style in the compilation settings: the result is the same either way – table captions are not being converted.

NB: Image captions work perfectly, using the same style – this is purely a problem with tables.

As far as I can tell, I’ve followed the instructions in the Manual, but of course, I may be making some sort of error.

What am I doing wrong? Has anyone else got this to work – I’ve tried searching on the forum, but haven’t come across this issue being reported yet.

Thanks!

You do need to use “Basic Multimarkdown” compile format for this to work out-of-the-box. For Default format you will probably need to duplicate+edit to set up the mappings yourself. You can see here there is not mapping of a style to the options setting:

For Pandoc, you need to preface the caption with Table: or just a : to get the caption understood. Scrivener fails to do this for Pandoc output (it uses [ and ]), but it is easy to set this up yourself.

Here is the Default format edited to hook up the Caption style to the “Multimarkdown Options” pane. You could also add the prefix and suffix yourself in the Styles pane and then you don’t need to use “Multimarkdown options” pane…

Default2.scrformat (38.6 KB)

2 Likes

@nontroppo, Thanks for the detailed reply!

You’re right, it did need the setting in your screenshot – that made the test project work properly.

But the bizarre thing is that the project where I first noticed the problem did have the Captions style option set properly. And when I copied and pasted it into the test project, that table caption failed to work there as well (will the setting correct).

That made me think it was something to do with the table itself. After a bit of investigation I found that the problem was triggered by the presence of an empty column at the right end of the table – drawn without borders as it was essentially padding for the PDF version.

Deleting that ‘dummy’ end column solved the problem and the caption appeared correctly. I’ve no idea why this should be, but I wouldn’t have found the answer without your help.

Thanks very much!

[EDIT] I’ve found out what the problem is…

The captions fails to be recognised any time there is an empty cell in the bottom right corner of the table. However, even a single space in the system is enough to correct the problem.

Using the previous example table:

Note how the Markdown table itself is produced identically: it’s just the caption which is affected. Odd, but the clear workaround is to have a space in the final cell!

4 Likes

Wow, very interesting bug, I’m sure you are a pioneer in uncovering this! :stuck_out_tongue_winking_eye: Perhaps @AmberV can add it to the bug list?

1 Like

Thanks! I’ve got it filed to take a look at, and also to look at the documentation and make sure it does a better job of indicating this is a matter of configuration rather than hard-coded behaviour.

2 Likes