r-lib / pkgdown

Generate static html documentation for an R package
https://pkgdown.r-lib.org/
Other
721 stars 335 forks source link

Extra vertical space in math mode #2741

Closed ramiromagno closed 3 months ago

ramiromagno commented 3 months ago

See:

This seems to be the case also with current pkgdown's article about math: https://pkgdown.r-lib.org/articles/test/rendering.html?q=math#math.

jayhesselberth commented 3 months ago

I'm not clear what the issue is here. Too much vertical space? Not enough?

IMO the math on the pkgdown website looks fine, and the div is pretty cropped already.

You can change the math rendering engine in pkgdown sites, and the rendered equations do have subtle differences (font types / sizes) between the engines.

You could also change spacing on a per-site basis with some custom CSS.

ramiromagno commented 3 months ago

Could you please take a screenshot? Because I see too much extra vertical space when compared to previous rendering with earlier versions of pkgdown.

hadley commented 3 months ago

It looks fine to me too. What browser are you using?

Screenshot 2024-08-01 at 07 44 53

ramiromagno commented 3 months ago

Thank you @hadley.

I noticed a big difference in the spacing from earlier versions to the newest version. I'm trying to generate a new website using pkgdown 2.0.0 to hopefully illustrate what I mean more clearly, so that you guys don't get the impression that this is just a small styling difference.

BTW: I'm using Firefox 125.0.3 (64-bit).

ramiromagno commented 3 months ago

okay, let me know if this difference is to be expected:

Just to make sure I communicate what I see in case there are browser / environment differences:

pkgdown 2.1.0


snap

pkgdown 2.0.0


snap2

hadley commented 3 months ago

This is how the pkgdown 2.1.0 website looks for me in safari:

Screenshot 2024-08-01 at 09 24 13

And this is what it looks like for me in firefox:

Screenshot 2024-08-01 at 09 26 29

So seems like something weird is going on on your end.

jayhesselberth commented 3 months ago

These differences could also be attributable to the (very) old MathJax that pkgdown was using in 2.0.0.

ramiromagno commented 3 months ago

Yeah, I am investigating what on my end might be causing this. Using ArchLinux is definitely a good clue...

I am looking into this: https://wiki.archlinux.org/title/Firefox#Some_MathML_symbols_are_missing.

But thanks for the all the help so far. Please don't close this issue just yet, even though it is clear that it is about my system, I would like to try to solve it and leave a solution here for others (even if that is a very tiny minority of users using Arch...) :)

ramiromagno commented 3 months ago

In firefox with pkgdown 2.1.0 after installing the Arch Linux package: https://archlinux.org/packages/extra/any/otf-latinmodern-math/, sanity is restored!

snap

Solution

To Archlinux folks out there:

yay -S otf-latinmodern-math

@hadley and @jayhesselberth: Thanks a lot for taking the time to help me out troubleshoot this.