soegaard2
2021-3-26 13:13:29

@comer Is the use case that the pages end up on a web page? If so, a solution might be to link to a cdn instead of embedding KaTeX ?


comer
2021-3-27 05:20:01

@suzanne.soy and @soegaard2: Thank you very much for your ideas and great support.

The use case for the HTML pages is for class notes and quizzes, as well as a little (student oriented) mathematical exposition magazine (in the near future). All of them written in Scribble with Scribble-math. I don’t expect much traffic, and because I’m using a free server (in my case: http://webfreehosting.net\|webfreehosting.net), I’m not sure if the cdn can be also free, but may be not, because it’s expected to support high traffic.

On the other hand, the several documents are relatively independent, and compiled also at different moments, so the idea of using include-sections, may not work in my case.

Thanks to @suzanne.soy particularly for the reference to (define-runtime-path katex-dir "katex"). With that information, the idea of a common-katex-folder may be (I’m not sure) implemented in the following way: 1. We create the identifier common-katex-holder? (with default #f) 2. If the user change common-katex-holder? to #t, then we follow steps 3 and 4. otherwise we proceed as normal (i.e. current implementation). 3. We create (relative to the current directory) the folder that will contain the common-katex. In Racket code we can do it with: (make-directory "../katex-holder"). After that we call: (define-runtime-path katex-dir "../katex-holder/katex") 4. Now, in the generated example.html file from the example.scrbl, we will need to refer correctly the katex-min.css, and the katex-min.js files, that is: href="../katex-holder/katex/katex-min.css" and src="../katex-holder/katex/katex-min.js". Note: the name “katex-holder” is just a possible name for the common-katex-folder (it can be constant). The above is only an idea that may work, t_hank you for sharing_ any further possibilities.

I apologize, because I will have to rest a little bit, may be for a few days, in this spring vacation. It has been great to be able to communicate with you. I appreciate very much each of your words. Enjoy also this special time. Please Keep Safe. Best regards.