Skip to content

Conversation

@allozaur
Copy link

@allozaur allozaur commented Nov 1, 2025

Changes according to ggml-org#16508 (comment).

Additionally applied a fix for an issue i met along the way with the blockquotes:

BEFORE AFTER
Zrzut ekranu 2025-11-1 o 16 32 28 Zrzut ekranu 2025-11-1 o 17 05 32

srogmann and others added 22 commits October 24, 2025 17:16
Code maintenance (variable names, code formatting, string handling)

Co-authored-by: Aleksander Grygier <[email protected]>
Moves KaTeX styling to SCSS for better customization and font embedding.

This change includes:
- Adding `sass` as a dev dependency.
- Introducing a custom SCSS file to override KaTeX variables and disable TTF/WOFF fonts, relying solely on WOFF2 for embedding.
- Adjusting the Vite configuration to resolve `katex-fonts` alias and inject SCSS variables.
Copy link
Author

@allozaur allozaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I think this is it @srogmann, but if you got any remarks lemme know! Otherwise let's merge it to your branch and move forward with merging the LaTeX/KaTeX improvements to the master branch!

@github-actions github-actions bot added documentation Improvements or additions to documentation Apple Metal labels Nov 1, 2025
@allozaur
Copy link
Author

allozaur commented Nov 1, 2025

@srogmann just realized i've merged a lot of commits from the master branch in the main repo, so i think that you could either rebase or merge it to yours as well and then the diff should become clean again in this PR.

@srogmann srogmann force-pushed the feature/svelte_latex_regex branch from f61bf52 to d8b0b11 Compare November 2, 2025 21:39
@srogmann
Copy link
Owner

srogmann commented Nov 2, 2025

@allozaur Thanks! I transferred the two commits via cherry-picking.

The future will demand changes, but the present is content:

Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

More info and automated migrator: https://sass-lang.com/d/import

   ╷
17 │ @import 'katex/src/styles/katex.scss';
   │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
    src/styles/katex-custom.scss 17:9  root stylesheet

Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
$ npm list|grep sass
├── [email protected]

.woff2-only in index.html and we got rid of the brittle regex :-):

$ zcat ../public/index.html.gz |cut -b1-60|grep -A4 "@font-face"|egrep "font-family|src: url"|head
  font-family: "KaTeX_AMS";
  src: url("data:font/woff2;base64,d09GMgABAAAAAG2sAA4AAAAA+
  font-family: "KaTeX_Caligraphic";
  src: url("data:font/woff2;base64,d09GMgABAAAAABsAAA4AAAAAM
  font-family: "KaTeX_Caligraphic";
  src: url("data:font/woff2;base64,d09GMgABAAAAABr8AA4AAAAAM
  font-family: "KaTeX_Fraktur";
  src: url("data:font/woff2;base64,d09GMgABAAAAACxUAA4AAAAAT
  font-family: "KaTeX_Fraktur";
  src: url("data:font/woff2;base64,d09GMgABAAAAACw0AA4AAAAAT

@allozaur
Copy link
Author

allozaur commented Nov 2, 2025

The future will demand changes, but the present is content:


Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.



More info and automated migrator: https://sass-lang.com/d/import



   ╷

17 │ @import 'katex/src/styles/katex.scss';

   │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   ╵

    src/styles/katex-custom.scss 17:9  root stylesheet



Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

Yes, of course I saw that. There's a comment about the deprecated @import usage added. Generally this would have to be addressed in the KaTeX scss files, but for this particular change this will be sufficient. I'll see how this gets addressed in the near future and decide how to proceed further.

@allozaur allozaur closed this Nov 3, 2025
@allozaur allozaur deleted the allozaur/feature/svelte_latex_regex branch November 3, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants