diff --git a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations/lib/insert_equations.js b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations/lib/insert_equations.js index aabffefb701..09893893542 100644 --- a/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations/lib/insert_equations.js +++ b/lib/node_modules/@stdlib/_tools/remark/plugins/remark-img-equations/lib/insert_equations.js @@ -22,6 +22,7 @@ var logger = require( 'debug' ); var createElement = require( '@stdlib/_tools/markdown/img-svg-equation' ); +var replace = require( '@stdlib/string/base/replace' ); var format = require( '@stdlib/string/format' ); @@ -35,6 +36,20 @@ var ALT = /alt="([^"]*)"/; var RAW = /raw="([^"]*)"/; +// FUNCTIONS // + +/** +* Substitutes LaTeX operators not supported by GitHub's MathJax configuration with supported operators. +* +* @private +* @param {string} tex - LaTeX equation +* @returns {string} substituted equation +*/ +function substitute( tex ) { + return replace( tex, /\\operatorname{([^}]*)}/g, '\\mathop{\\mathrm{$1}}' ); +} + + // MAIN // /** @@ -95,7 +110,7 @@ function insertEquations( node, index, parent ) { mathNode = { 'type': 'html', - 'value': '```math\n'+raw+'\n```' + 'value': '```math\n'+substitute(raw)+'\n```' }; divNode = { 'type': 'html', diff --git a/lib/node_modules/@stdlib/simulate/iter/triangle-wave/README.md b/lib/node_modules/@stdlib/simulate/iter/triangle-wave/README.md index 27e76d74d1b..60a405f1974 100644 --- a/lib/node_modules/@stdlib/simulate/iter/triangle-wave/README.md +++ b/lib/node_modules/@stdlib/simulate/iter/triangle-wave/README.md @@ -31,7 +31,7 @@ A triangle waveform is represented by the following equation ```math -f(t; \tau, a, \varphi) = \frac{2a}{\pi} \operatorname{arcsin} \sin \frac{2\pi(t-\varphi)}{\tau} +f(t; \tau, a, \varphi) = \frac{2a}{\pi} \mathop{\mathrm{arcsin}} \sin \frac{2\pi(t-\varphi)}{\tau} ``` ```math -h\left( X \right) = \ln(\operatorname{Beta}(\alpha,\beta)) - (\alpha-1)\psi(\alpha) - (\beta-1)\psi(\beta) + (\alpha+\beta-2)\psi(\alpha+\beta) +h\left( X \right) = \ln(\mathop{\mathrm{Beta}}(\alpha,\beta)) - (\alpha-1)\psi(\alpha) - (\beta-1)\psi(\beta) + (\alpha+\beta-2)\psi(\alpha+\beta) ``` ```math -F(x;\alpha,\beta) = \frac{\operatorname{Beta}(x;\alpha,\beta)}{\operatorname{Beta}(\alpha,\beta)} +F(x;\alpha,\beta) = \frac{\mathop{\mathrm{Beta}}(x;\alpha,\beta)}{\mathop{\mathrm{Beta}}(\alpha,\beta)} ``` ```math -F(x; x_0,\gamma)=\frac{1}{\pi} \operatorname{arctan} \left(\frac{x-x_0}{\gamma}\right)+\frac{1}{2} +F(x; x_0,\gamma)=\frac{1}{\pi} \mathop{\mathrm{arctan}} \left(\frac{x-x_0}{\gamma}\right)+\frac{1}{2} ``` ```math -F(x; x_0,\gamma)=\frac{1}{\pi} \operatorname{arctan} \left(\frac{x-x_0}{\gamma}\right)+\frac{1}{2} +F(x; x_0,\gamma)=\frac{1}{\pi} \mathop{\mathrm{arctan}} \left(\frac{x-x_0}{\gamma}\right)+\frac{1}{2} ``` ```math -F(x;\mu,b) =\tfrac{1}{2} + \tfrac{1}{2} \operatorname{sgn}(x-\mu) \left(1-\exp \left(-\frac{|x-\mu|}{b} \right ) \right ) +F(x;\mu,b) =\tfrac{1}{2} + \tfrac{1}{2} \mathop{\mathrm{sgn}}(x-\mu) \left(1-\exp \left(-\frac{|x-\mu|}{b} \right ) \right ) ``` ```math -F(x;\mu,b) =\tfrac{1}{2} + \tfrac{1}{2} \operatorname{sgn}(x-\mu) \left(1-\exp \left(-\frac{|x-\mu|}{b} \right ) \right ) +F(x;\mu,b) =\tfrac{1}{2} + \tfrac{1}{2} \mathop{\mathrm{sgn}}(x-\mu) \left(1-\exp \left(-\frac{|x-\mu|}{b} \right ) \right ) ``` ```math -Q(p) = \mu - b\,\operatorname{sgn}(p-0.5)\,\ln(1 - 2|p-0.5|) +Q(p) = \mu - b\,\mathop{\mathrm{sgn}}(p-0.5)\,\ln(1 - 2|p-0.5|) ``` ```math -F(x;\mu,b) = \begin{cases} \operatorname{erfc}\left(\sqrt{\frac{c}{2(x-\mu)}}\right) & \text{ for } x > \mu \\ 0 & \text{ otherwise } \end{cases} +F(x;\mu,b) = \begin{cases} \mathop{\mathrm{erfc}}\left(\sqrt{\frac{c}{2(x-\mu)}}\right) & \text{ for } x > \mu \\ 0 & \text{ otherwise } \end{cases} ``` ```math -F(x;\mu,b) = \begin{cases} \operatorname{erfc}\left(\sqrt{\frac{c}{2(x-\mu)}}\right) & \text{ for } x > \mu \\ 0 & \text{ otherwise } \end{cases} +F(x;\mu,b) = \begin{cases} \mathop{\mathrm{erfc}}\left(\sqrt{\frac{c}{2(x-\mu)}}\right) & \text{ for } x > \mu \\ 0 & \text{ otherwise } \end{cases} ``` ```math -\operatorname{Median}\left( X \right) = \mu + \frac{c}{2(\operatorname{erfcinv}(1/2))^2} +\operatorname{Median}\left( X \right) = \mu + \frac{c}{2(\mathop{\mathrm{erfcinv}}(1/2))^2} ``` ```math -Q(p;\mu,c)= \mu + \frac{c}{2 \cdot \operatorname{erfcinv}(p)^2} +Q(p;\mu,c)= \mu + \frac{c}{2 \cdot \mathop{\mathrm{erfcinv}}(p)^2} ``` ```math -M_X(t) := \mathbb{E}\!\left[e^{tX}\right] = e^{\mu t}\operatorname{B}(1-st, 1+st) +M_X(t) := \mathbb{E}\!\left[e^{tX}\right] = e^{\mu t}\mathop{\mathrm{B}}(1-st, 1+st) ``` ```math -F(x;\mu,\sigma)=\frac12 + \frac12\,\operatorname{erf}\left[\frac{\ln x-\mu}{\sqrt{2}\sigma}\right] +F(x;\mu,\sigma)=\frac12 + \frac12\,\mathop{\mathrm{erf}}\left[\frac{\ln x-\mu}{\sqrt{2}\sigma}\right] ``` ```math -\operatorname{MDA} = \begin{cases} 1 & \textrm{if}\ N = 1 \\\frac{1}{N} \sum_{i=1}^{N} \delta_{\operatorname{sgn}(\Delta f_{i,i-1}),\ \operatorname{sgn}(\Delta a_{i,i-1})} & \textrm{if}\ N > 1 \end{cases} +\operatorname{MDA} = \begin{cases} 1 & \textrm{if}\ N = 1 \\\frac{1}{N} \sum_{i=1}^{N} \delta_{\mathop{\mathrm{sgn}}(\Delta f_{i,i-1}),\ \mathop{\mathrm{sgn}}(\Delta a_{i,i-1})} & \textrm{if}\ N > 1 \end{cases} ``` ```math -\rho_{X,Y} = \frac{\operatorname{cov}(X,Y)}{\sigma_X \sigma_Y} +\rho_{X,Y} = \frac{\mathop{\mathrm{cov}}(X,Y)}{\sigma_X \sigma_Y} ``` ```math -\rho_{X,Y} = \frac{\operatorname{cov}(X,Y)}{\sigma_X \sigma_Y} +\rho_{X,Y} = \frac{\mathop{\mathrm{cov}}(X,Y)}{\sigma_X \sigma_Y} ``` ```math -d_{x,y} = 1 - r_{x,y} = 1 - \frac{\operatorname{cov_n(x,y)}}{\sigma_x \sigma_y} +d_{x,y} = 1 - r_{x,y} = 1 - \frac{\mathop{\mathrm{cov_n(x,y)}}}{\sigma_x \sigma_y} ``` ```math -d_{x,y} = 1 - r_{x,y} = 1 - \frac{\operatorname{cov_n(x,y)}}{\sigma_x \sigma_y} +d_{x,y} = 1 - r_{x,y} = 1 - \frac{\mathop{\mathrm{cov_n(x,y)}}}{\sigma_x \sigma_y} ``` ```math -\rho_{X,Y} = \frac{\operatorname{cov}(X,Y)}{\sigma_X \sigma_Y} +\rho_{X,Y} = \frac{\mathop{\mathrm{cov}}(X,Y)}{\sigma_X \sigma_Y} ```