Replies: 2 comments 2 replies
-
Hello, here is a jQuery alternative to put in bold both the figure label ("Figure" or "Fig." hereafter) and the figure listing number (up to 99): <script>
// Iterate over figure caption element
$( "figure.figure > figcaption.figure-caption" ).each(function(){
// store numeric variable and replace by bold version
$(this).html($(this).text().replace(/^(Fig\.\s\d{1,2})/, function($1) {return "<b>" + $1 + "</b>";}));
});
</script> The script needs to be saved as a ".html" file and included as per the documentation. The corresponding format:
html:
crossref:
fig-title: Fig.
title-delim: \. If you use a different |
Beta Was this translation helpful? Give feedback.
1 reply
-
For reference, the suggestion to have a way to have bold labels: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to figure out how to modify the style of "Figure 1" in an image caption. Basically, you can specify the
fig-title
parameter in the yaml headerBut the result will be that "Figure" shows in bold, and "1" shows in normal style. However, I want to change the style of both, Figure and the cross reference. I thought that I will write a simple pandoc lua filter to take care of it. This is not a complicated job, but it turns out that in the AST that my filter gets from pandoc there are no caption titles or crossreferences, just the image captions specified by the document.
Therefore, unfortunately, it looks like the figure numbering is done after my filter runs on the pandoc AST.
One solution would be to make quarto create a native format, and then process it with pandoc to get the final HTML. But that way I loose all the Quarto visual goodies!
Another one, which I tried and which works (sort of) is to parse the HTML produced by quarto using another instance of pandoc:
The filter itself:
However, this is a hack, not a proper solution. It depends on how exactly the HTML from quarto looks like, on the fact that figure title is "Figure" and not, for example, "Abbildung" etc.
Is there a better solution?
Beta Was this translation helpful? Give feedback.
All reactions