Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shifted Figure Reference Numbers #248

Open
vysecurity opened this issue May 3, 2024 · 7 comments
Open

Shifted Figure Reference Numbers #248

vysecurity opened this issue May 3, 2024 · 7 comments

Comments

@vysecurity
Copy link

vysecurity commented May 3, 2024

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:

Thorium-2024-05-03 at 13 32 31@2x

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;
}
@vysecurity
Copy link
Author

I fixed it by just referencing the master CSS and deleting all my stuff.

@vysecurity
Copy link
Author

Another bug here though:

Thorium-2024-05-03 at 14 26 51@2x

See how the text is squished when you try to reference the figure. The space disappears.

@MWedl
Copy link
Contributor

MWedl commented May 6, 2024

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)

@vysecurity
Copy link
Author

Any luck on fixing this?

@vysecurity vysecurity reopened this Jul 21, 2024
@MWedl
Copy link
Contributor

MWedl commented Jul 29, 2024

Not yet. The weasyprint issue is still open.

@vysecurity
Copy link
Author

Sad times. Any way I can just contribute and fix it? Probably a 30 minute AI generation fix.

@aronmolnar
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants