Skip to content

Conversation

@fneumann
Copy link
Owner

@fneumann fneumann commented Feb 20, 2025

This PR proposes to add a new component Legacy\LatexContent to the UI framework. It is related to the corresponding feature request Streamline LaTeX usage .

Legacy\LatexContent is used as an intermediate solution for legacy content with mathematical formulas that are rendered by the JavaScript library MathJax. The LaTeX code of these formulas must be wrapped in the delimiters [tex] and [tex].

The modification of page content by MathJax is controlled by CSS classes. The class tex2jax_ignore is added to the body element of a page to prevent a modification outside Legacy\LatexContent. These contents are wrapped in elements with a class tex2jax_process to enable the modification inside.

Legacy\LatexContent registers a JavaScript file mathjax.js on the page. This file configures and loads MathJax asynchronously. MathJax scans the page for content to be processed and subsequently loads additional modules. All resources that are needed by MathJax are defined by the class DefaultLatexResources implementing the interface LatexResources. It is used by the UI framework to populate the public folder with these resources, and it is offered to other Components by a 'Define/Use' integration to support the export of the resources for offline content.

The Legacy\Factory is added to provide separate renderers for the legacy components Content and LatexContent. This way the resources for MathJax are only added to pages that use LatexContent. However, these are stilly many pages because the content of the ILIAS page editor needs to be wrapped in a LatexContent component.

Compared to the previous pull request, this new one does not inject a configuration to the UI framework by ILIAS. That means there is no setup switch to prevent the inclusion of the MathJax library on the page once a LatexContent is included, event if it does not have a LaTeX formula at all.

alex40724 and others added 30 commits May 26, 2025 15:58
tst_res_tab_msg_res_after...
   _date_no_res
   _finish_test
   _taking_test
   _test_passed

(cherry picked from commit 3eb2701)
(cherry picked from commit fade2b7)
…AS-eLearning#9545)

* Bugfix 45021

* Insert Version in sk.lang and zh.lang

* Fix Copyright

---------

Co-authored-by: Keven Clausen <keven.clausen@kroeplin-projekte.de>
schmitz-ilias and others added 29 commits July 1, 2025 09:17
Co-authored-by: Felix Jonas Wiegleb <jwiegleb@databay.de>
…zeigt (ILIAS-eLearning#9744)

* fix(44826): include scss rules for displaying latex in the editor

* style: remove double new lines

(cherry picked from commit 1b90a73)
@fneumann fneumann force-pushed the dev11-streamline-latex-ui-modification branch from e2b6816 to 04660bd Compare July 10, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.