Shifted Figure Reference Numbers
Since I updated from the traditional sysreptor version to the latest version, I found that the figCounter is now off.
I do:
![Caption here](){#superman}
And it says See Fig 1
Fig 2: Caption here.
It's off compared to the previous versions.
Example:
Example CSS:
/* Figure */
figcaption::before {
content: var(--prefix-figure) counter(figCounter) " - ";
}
.ref-figure::before {
content: var(--prefix-figure) target-counter(attr(href), figCounter);
font-weight: normal !important;
font-family: "Source Code Pro", sans-serif !important;
font-size: 9pt !important;
font-color: #296a70 !important;
color: #296a70 !important;
}
I fixed it by just referencing the master CSS and deleting all my stuff.
Another bug here though:
See how the text is squished when you try to reference the figure. The space disappears.
We are aware of the missing space after figure reference bug. The root cause is in weasyprint (HTML+CSS to PDF rendering library). Until the bug is fixed we recommend to use one of the following workarounds:
- Add a non-breakable space after the reference in markdown code
[](#figure-id) shows ... - Place the image before the reference in markdown code. The missing space bug only occurs when referencing figures that are rendered below the reference.
- Change the sentence structure such that no space is after the reference e.g. by putting the reference in parenthesis
... text (see figure 5)
Any luck on fixing this?
Not yet. The weasyprint issue is still open.
Sad times. Any way I can just contribute and fix it? Probably a 30 minute AI generation fix.
As it's a Weasyprint bug, you would have to contribute it there.
AFAIK Weasyprint will soon release v63.1, so if you can and are willing to fix it, now would be a good point in time probably.
Tracked in https://github.com/Kozea/WeasyPrint/issues/1875