Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
react-mathjax4
Advanced tools
React component to display math formulas written in AsciiMath or TeX with by default profile TeX-AMS_HTML. Profile can be updated by passing stat props.
npm install react-mathjax4 --save
import MathJax from 'react-mathjax4'
const ascii = 'U = 1/(R_(si) + sum_(i=1)^n(s_n/lambda_n) + R_(se))'
const content = `This can be dynamic text (e.g. user-entered) text with ascii math embedded in $$ symbols like $$${ascii}$$`
module.exports = () => {
return (
<MathJax.Context
input='ascii'
onLoad={ () => console.log("Loaded MathJax script!") }
onError={ (MathJax, error) => {
console.warn(error);
console.log("Encountered a MathJax error, re-attempting a typeset!");
MathJax.Hub.Queue(
MathJax.Hub.Typeset()
);
} }
script="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=AM_HTMLorMML"
options={ {
asciimath2jax: {
useMathMLspacing: true,
delimiters: [["$$","$$"]],
preview: "none",
}
} }
>
<MathJax.Text text={ content }/>
</MathJax.Context>
);
}
import MathJax from 'react-mathjax4'
const ascii = 'U = 1/(R_(si) + sum_(i=1)^n(s_n/lambda_n) + R_(se))'
module.exports = () => {
return (
<div>
<MathJax.Context input='ascii'>
<div>
This is an inline formula written in AsciiMath: <MathJax.Node inline>{ ascii }</MathJax.Node>
</div>
</MathJax.Context>
</div>
);
}
import MathJax from 'react-mathjax4'
const ascii = 'U = 1/(R_(si) + sum_(i=1)^n(s_n/lambda_n) + R_(se))'
module.exports = () => {
return (
<div>
<MathJax.Context input='ascii'>
<div>
<MathJax.Node>{ascii}</MathJax.Node>
</div>
</MathJax.Context>
</div>
);
}
import MathJax from 'react-mathjax4'
const tex = `f(x) = \\int_{-\\infty}^\\infty\\hat f(\\xi)\\,e^{2 \\pi i \\xi x}\\,d\\xi`
module.exports = () => {
return (
<div>
<MathJax.Context input='tex'>
<div>
This is an inline math formula: <MathJax.Node inline>{'a = b'}</MathJax.Node>
</div>
</MathJax.Context>
</div>
);
}
import MathJax from 'react-mathjax4'
const tex = `f(x) = \\int_{-\\infty}^\\infty\\hat f(\\xi)\\,e^{2 \\pi i \\xi x}\\,d\\xi`
module.exports = () => {
return (
<div>
<MathJax.Context input='tex'>
<div>
<MathJax.Node>{tex}</MathJax.Node>
</div>
</MathJax.Context>
</div>
);
}
MathJax.Context
propsscript
(String)https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML
input
(String)tex
| ascii
ascii
delay
(Number)options
(Object)onLoad
(Function)false
)onError
(Function)noGate
(Boolean)false
, controls whether to disallow rendering of children components until the MathJax script has finished loadingThis project is licensed under the MIT License - see the LICENSE.md file for details.
FAQs
React component for MathJax with by default TeX-AMS_HTML
We found that react-mathjax4 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.