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

[BUG] KaTeX fonts cannot be downloaded #285

Open
splintersuidman opened this issue Feb 22, 2023 · 6 comments
Open

[BUG] KaTeX fonts cannot be downloaded #285

splintersuidman opened this issue Feb 22, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@splintersuidman
Copy link

Describe the bug
The KaTeX fonts cannot be downloaded which causes the preview not to follow the KaTeX font commands correctly. It seems the font files, hosted in _next/static/media are cut short to 51 characters. Whereas the font at /_next/static/media/KaTeX_Script-Regular.c81d1b2a4b75d3eded6059a210910a6b.woff2 cannot be downloaded, there is a font at /_next/static/media/KaTeX_Script-Regular.c81d1b2a4b75d3eded6059a210910a.

To Reproduce
Preview a node which contains a KaTeX font command like \mathscr{C} or \mathbb{Z}.

Expected behavior
\mathscr{C} creates a script C, \mathbb{Z} creates a blackboard bold Z.

Screenshots
Here is an example of what the preview looks like:
Screenshot_20230222_101251

And this is how the \mathscr{C} and \mathscr{J} should look:
Screenshot_20230222_101226

The following screenshot shows the font download errors in the browser’s console:
Screenshot_20230222_101329

The directory listing for _next/static/media reveals that the file names are cut short (sometimes they contain no file extension, sometimes only part of it, e.g., .wo instead of .woff):
Screenshot_20230222_101416

What browser were you using?
Firefox

@splintersuidman splintersuidman added the bug Something isn't working label Feb 22, 2023
@tefkah
Copy link
Contributor

tefkah commented Feb 23, 2023

hmmmm weird. for me $\mathscr{C}$ and $\mathbb{B}$ show up as shown here (Firefox and chromium)

image

all the fonts are listed correctly for me as well
image

Is this maybe an issue of your OS? Maybe your .emacs is nested so deeply that it is cutting of these characters when org-roam-ui is downloaded?

@splintersuidman
Copy link
Author

Is this maybe an issue of your OS?

Hm, that could pretty well be the case. I use NixOS to install org-roam-ui, and the font file lives at /nix/store/4lc2xz9jz6vnlpg57wdyq2lqg9yba0qq-emacs-org-roam-ui-20221105.1040/share/emacs/site-lisp/elpa/org-roam-ui-20221105.1040/out/_next/static/media/KaTeX_Script-Regular.c81d1b2a4b75d3eded6059a210910a (which is 203 characters, which seems to be shorter than the default maximum filename length?). Maybe this is rather a NixOS/Nixpkgs issue than an org-roam-ui one. I will investigate further.

@skittishdev
Copy link

skittishdev commented Apr 3, 2023

I have the same issue on Mac OS X.

Files are present, but the extensions seem to be cut-off. Mac OS supports upto 255 characters for file name, and I verified that the path is 131 chars.

├── KaTeX_AMS-Regular.73ea273a72f4aca30ca528cf9117470a.
├── KaTeX_AMS-Regular.853be92419a6c3766b9afe7a7c3e32fa.
├── KaTeX_AMS-Regular.d562e886c52f12660a41eea8d05af757.
├── KaTeX_Caligraphic-Bold.7489a2fbfb9bfe70442031a27fb5
├── KaTeX_Caligraphic-Bold.a1abf90dfd72792a577a5a43382b
├── KaTeX_Caligraphic-Bold.d757c535a2e5902f1325192d99e0
├── KaTeX_Caligraphic-Regular.7e873d3833eb108a0758be45c
├── KaTeX_Caligraphic-Regular.d6484fce1ef428d5bd94a903d
├── KaTeX_Caligraphic-Regular.db074fa22cf224af93d7b2122
├── KaTeX_Fraktur-Bold.354501bac435c3264834b80301089bad
├── KaTeX_Fraktur-Bold.4c761b3711973ab04edf7ea6f1fbacdc
├── KaTeX_Fraktur-Bold.931d67ea207ab37ee693ff155ff4d7a6
├── KaTeX_Fraktur-Regular.172d3529b26f8cedef6b5ddef7546
├── KaTeX_Fraktur-Regular.6fdf0ac577be0ba82a4c9a89b8eef
├── KaTeX_Fraktur-Regular.ed305b5434865e06ffde7da0d2810
├── KaTeX_Main-Bold.0c3b8929d377c0e9b2f3a9c872e3337b.wo
├── KaTeX_Main-Bold.39890742bc957b368704509bb2f4163c.wo
├── KaTeX_Main-Bold.8169508bf58f8bd92ad8a768ede68a18.tt

Not sure when this bug showed up (I auto-update my packages on a weekly basis), but I am currently using 20221105.1040

@tefkah
Copy link
Contributor

tefkah commented Apr 5, 2023

hmmm very strange. @skittishdev do you use any non-emacs package managing solution to install org-roam-ui?

@tefkah
Copy link
Contributor

tefkah commented Apr 5, 2023

one other thing to check is that this might be a Melpa problem, could you try pulling org-roam-ui directly from the github repo?

@skittishdev
Copy link

skittishdev commented Apr 6, 2023

do you use any non-emacs package managing solution to install org-roam-ui?

No, I use MELPA and use-package with package.el.

could you try pulling org-roam-ui directly from the github repo?

No change in behavior. Used straight.el

(use-package org-roam-ui
  :straight (org-roam-ui :type git :host github :repo "org-roam/org-roam-ui")
  :after org-roam
  :bind (
         ("C-c n u" . org-roam-ui-open)
         ("C-c n n" . org-roam-ui-node-local)
         )
  :custom
  (org-roam-ui-sync-theme t)
  (org-roam-ui-follow t)
  (org-roam-ui-update-on-save t)
  (org-roam-ui-open-on-start nil))

Some additional context

  • I'm using emacs-29, but I tried reverting to emacs-28, and still see the same issue by pulling in org-roam-ui from MELPA and from Github
  • org-roam-ui has trouble processing #+BEGIN_EXPORT latex blocks, but for latex embedded within the org file, it seems to be able to display LaTeX correctly (but see the original report for problems with Katex directives). Also, the Katex font errors still show up even with latex embedded in the org file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants