MediaWiki and Wikipedia authors usually use LaTeX to define mathematical formulas in the wiki text markup. In the Wikimedia ecosystem, these formulas were processed by a long cascade of web services and finally delivered to users' browsers in rendered form for visually readable representation as SVG. With the latest developments of supporting MathML Core in Chromium-based browsers, MathML continues its path to be a de facto standard markup language for mathematical notation in the web. Conveying formulas in MathML enables semantic annotation and machine readability for extended interpretation of mathematical content, in example for accessibility technologies. With this work, we present WikiTexVC, a novel method for validating LaTeX formulas from wiki texts and converting them to MathML, which is directly integrated into MediaWiki. This mitigates the shortcomings of previously used rendering methods in MediaWiki in terms of robustness, maintainability and performance. In addition, there is no need for a multitude of web services running in the background, but processing takes place directly within MediaWiki instances. We validated this method with an extended dataset of over 300k formulas which have been incorporated as automated tests to the MediaWiki continuous integration instances. Furthermore, we conducted an evaluation with 423 formulas, comparing the tree edit distance for produced parse trees to other MathML renderers. Our method has been made available Open Source and can be used on German Wikipedia and is delivered with recent MediaWiki versions. As a practical example of enabling semantic annotations within our method, we present a new macro that adds content to formula disambiguation to facilitate accessibility for visually impaired people.
翻译:MediaWiki和维基百科作者通常使用LaTeX在维基文本标记中定义数学公式。在维基媒体生态系统中,这些公式经过一系列网络服务的长链路处理,最终以SVG的可视化渲染形式传输至用户浏览器。随着基于Chromium的浏览器对MathML Core的支持发展,MathML正逐步成为网络数学符号的事实标准标记语言。以MathML形式传递公式可实现语义标注和机器可读性,从而扩展数学内容的解读能力,例如用于无障碍技术。本研究提出WikiTexVC——一种从维基文本验证LaTeX公式并将其转换为MathML的新型方法,该方法直接集成于MediaWiki中。这弥补了MediaWiki先前渲染方法的缺陷,在鲁棒性、可维护性和性能方面显著提升。此外,该方法无需后台运行多组网络服务,处理过程直接在MediaWiki实例内完成。我们通过一个包含超30万条公式的扩展数据集验证了该方法,这些公式已作为自动化测试集成至MediaWiki的持续集成实例中。同时,我们选取423条公式进行评测,通过比较生成解析树的树编辑距离与其他MathML渲染器的差异。该方法已作为开源项目发布,可在德语维基百科中使用,并随最新版MediaWiki分发。为展示方法中语义标注的实际应用,我们提出一种新型宏,其通过向公式消歧内容添加信息,辅助视障人士获取无障碍支持。