How to display Math equations in React Native View

后端 未结 2 1072
自闭症患者
自闭症患者 2021-02-18 21:49

How to render Math equations in React Native Views? For web applications, we can use LaTex or MathJax solutions. But React Native renders native components. Using WebView will b

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-18 22:39

    There is a library for MathJax in React Native. Library does not work properly sometimes, but you should try it. https://github.com/calvinkei/react-native-mathjax#readme

    Usage

    This is an equation

    '} // MathJax config option mathJaxOptions={{ messageStyle: 'none', extensions: [ 'tex2jax.js' ], jax: [ 'input/TeX', 'output/HTML-CSS' ], tex2jax: { inlineMath: [ ['$','$'], ['\\(','\\)'] ], displayMath: [ ['$$','$$'], ['\\[','\\]'] ], processEscapes: true, }, TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'] } }} {...WebView props} />

提交回复
热议问题