jekyll-figure icon indicating copy to clipboard operation
jekyll-figure copied to clipboard

Figure numbering?

Open grauschnabel opened this issue 6 years ago • 1 comments

Hi there,

is there an easy way to automatically add "Figure X" to the caption, where X is an incrementing number? So it works fine if we add more figures to have the numbers right?

And can I link to that figure number with a reference?

Thanks, Martin

grauschnabel avatar Apr 25 '19 12:04 grauschnabel

See pull request.

grauschnabel avatar May 04 '19 18:05 grauschnabel

I have merged your PR and released it in v0.2.0. I did however make one change: links to referenced figures now include the localised figure word as well as the number:

  See {% figref example %}.  

- See figure <a href="#example>1</a>.
+ See figure <a href="#example>figure 1</a>.

This is because a number on its own lacks any context. For example, if browsing a page of links with a screenreader, you’d only hear 🗣️ “Link: 1, Link: 2”. By including the localised figure word, these links make more sense: 🗣️ “Link: figure 1, Link: figure 2”.

Of course, this may break how you’ve been using your fork of this plugin, so before upgrading, you may want to review how you are using the figref tag in your work.

Thanks for your contribution, and again, sorry for the extreme delay.

paulrobertlloyd avatar Sep 23 '23 22:09 paulrobertlloyd