Using the scribble-math package with relative path for katex folder

The scribble-math package is great for rendering LaTeX style formatted expressions. When used in multiple documents (e.g. quizzes, exams, class notes, et c.) it is very convenient to save time and space requiring only one copy of the katex folder, and not a katex folder for each generated scribble document. One easy way to accomplish that (with the current scribble-math version) is changing the html file generated by the "Scribble HTML" button, in the following way:

[Relevant part of the] originally generated HTML content:

(function() {
  document.write('<link rel="stylesheet" href="katex/katex.min.css" />');
})();(function() {document.write('<scr' + 'ipt type="text/javascript" src="katex/katex.min.js"></scr' + 'ipt>');})();

Modified HTML content: Just adding the prefix "../" in the paths for the files katex.min.css and katex.min.js, resulting as:

(function() {
  document.write('<link rel="stylesheet" href="../katex/katex.min.css" />');
})();(function() {document.write('<scr' + 'ipt type="text/javascript" src="../katex/katex.min.js"></scr' + 'ipt>');})();

Observation: I do the above modification for each revision of the different documents (mainly quizzes, class notes) used in an academic semester.

Question: Would it be possible to add some optional parameter in the scribble-math package, in order to just add that prefix to the two file paths mentioned above? (I understand that other alternative solutions may be possible).

Thank you very much for your comments and support on this issue.
E. Comer
P. S. Formerly I asked for this functionality, but was unable to express it in the right terms. I apologize for that. Thank you to the scribble-math package developer for this very useful and important package for creating mathematically oriented documents.

As a reference: the katex folder, contains two subfolders, and 84 files, mostly font files. The quantity of files is the main reason to create the folders and files just once, for a collection of documents, and then for each document, refer only to the katex folder in just one location.

Thank you for your suggestions and possible solutions.

I am sure Suzanne will accept a PR to that solves this.

Thank you for your suggestions and possible solutions .

An alternative solution is to make symbolic links from the "katex" subfolders to a shared folder.

BTW: It's worth sending either an email to Suzanne or making an issue at the Github repo.

Thank you @soegaard for sharing your ideas. I hope the eventual solution will be useful also for other users.

Thank you again @soegaard for your previous suggestion. I just published a comment on GitHub (Fixed bugs reported by @encomer on Slack. Thanks! · SuzanneSoy/scribble-math@a69b6fa · GitHub), with what seems to be a solution to the issue.
Best regards.

Maybe there should be a parameter that specifies the exact path to be used to the katex folder in generated output. Default should probably be the present behaviour.

Thank you @hendrikboom3 , it works exactly as you said, if the package is updated with the code changes as indicated in the comment mentioned in the post with link: Using the scribble-math package with relative path for katex folder - #5 by encomer.

For example, the following code:

#lang scribble/manual
@;; doc1.scrbl
@require[scribble-math]
@title{Testing}
@(use-external-katex
  (list "../katex/katex.min.js"
        "../katex/katex.min.css"))
@$${\sum_{i=1}^n\;i=\dfrac{n(n+1)}{2}}

Change the default behaviour, and do not create the katex folder locally, but accept the declaration that there is already a katex sibling folder with the needed files, and the doc1.html is created accordingly, in this case, with the code:

... href="../katex/katex.min.css" ...
... src="../katex/katex.min.js" ...

instead of the default code:

... href="katex/katex.min.css" ...
... src="katex/katex.min.js" ...

This happily works, thanks to the previous preparatory changes made to the dollar.rkt file in the scribble-math package by Suzanne. But the above mentioned changes, have to be made, in order for the function (use-external-katex ..) to work properly.

Thank you again @hendrikboom3 for your comment. We hope for an update in the near future, of this very useful scribble-math package, in order to be able to use it without technical changes in the installation of our students and/or colleagues.

Kind regards.