Mathjax脱机以进行Web视图 [英] Mathjax offline for web view
问题描述
通过链接mathjax cdn来进行本机反应,通常使用Webview来呈现数学内容.但是如何解决使其脱机的问题.
Using webview to render math content by linking mathjax cdn for react native is common. But how to approach the problem of making it offline.
-
是否可以在本地维护该捆绑包?
Is there a way to locally maintain that bundle?
它甚至更受欢迎吗?
捆绑包的大小是多少?我不希望我的应用程序大小超过10mb.
What will be the size of the bundle ? I dont want my app size to go beyond 10mb.
推荐答案
从
http://docs.mathjax.org/en/latest/installation.html
进入=> android/app/src/main/assets/
into => android/app/src/main/assets/
现在您的Webview html代码集脚本参考
Now in your webview html code set script reference to
<script src="file:///android_asset/MathJax/MathJax.js?config=TeX-MML-AM_CHTML"></script>
和html内的必要配置. 另外,请确保将基本URL设置为您的文件夹名称.
and your necessary config inside html. Also make sure to set base url to your folder name.
<WebView source={{ html, baseUrl: 'file:///android_asset/MathJax/' }} />
您还可以 https://github.com/mathjax/MathJax-grunt-cleaner 通过删除不需要的字体和格式来减小Mathjax资产的大小.
Also you can https://github.com/mathjax/MathJax-grunt-cleaner to reduce the Mathjax asset size by removing unnecessary fonts and formats that you don't use.
这篇关于Mathjax脱机以进行Web视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!