"<span class=\"katex\"><span class=\"katex-mathml\"><math><semantics><mrow><mfrac><mrow><mrow><mi mathvariant=\"normal\">T</mi><mi mathvariant=\"normal\">P</mi></mrow></mrow><mrow><mrow><mi mathvariant=\"normal\">T</mi><mi mathvariant=\"normal\">P</mi></mrow><mo>+</mo><mrow><mi mathvariant=\"normal\">F</mi><mi mathvariant=\"normal\">N</mi></mrow></mrow></mfrac></mrow><annotation encoding=\"application/x-tex\">\\frac{\\mathrm{TP}}{\\mathrm{TP}+\\mathrm{FN}}</annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"strut\" style=\"height:0.872331em;\"></span><span class=\"strut bottom\" style=\"height:1.275662em;vertical-align:-0.403331em;\"></span><span class=\"base\"><span class=\"mord\"><span class=\"mopen nulldelimiter\"></span><span class=\"mfrac\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.872331em;\"><span style=\"top:-2.655em;\"><span class=\"pstrut\" style=\"height:3em;\"></span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\"><span class=\"mord mtight\"><span class=\"mord mathrm mtight\">T</span><span class=\"mord mathrm mtight\">P</span></span><span class=\"mbin mtight\">+</span><span class=\"mord mtight\"><span class=\"mord mathrm mtight\">F</span><span class=\"mord mathrm mtight\">N</span></span></span></span></span><span style=\"top:-3.15em;\"><span class=\"pstrut\" style=\"height:3em;\"></span><span class=\"stretchy\" style=\"height:0.2em;\"><svg width='400em' height='0.2em' viewBox='0 0 400000 200' preserveAspectRatio='xMinYMin slice'><path d='M0 80H400000 v40H0z M0 80H400000 v40H0z'/></svg></span></span><span style=\"top:-3.394em;\"><span class=\"pstrut\" style=\"height:3em;\"></span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\"><span class=\"mord mtight\"><span class=\"mord mathrm mtight\">T</span><span class=\"mord mathrm mtight\">P</span></span></span></span></span></span><span class=\"vlist-s\"></span></span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.403331em;\"></span></span></span></span><span class=\"mclose nulldelimiter\"></span></span></span></span></span>"
'<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mfrac><mrow><mi mathvariant="normal">T</mi><mi mathvariant="normal">P</mi></mrow><mrow><mrow><mi mathvariant="normal">T</mi><mi mathvariant="normal">P</mi></mrow><mo>+</mo><mrow><mi mathvariant="normal">F</mi><mi mathvariant="normal">N</mi></mrow></mrow></mfrac></mrow><annotation encoding="application/x-tex">\\frac{\\mathrm{TP}}{\\mathrm{TP}+\\mathrm{FN}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.275662em;vertical-align:-0.403331em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.872331em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">T</span><span class="mord mathrm mtight">P</span></span><span class="mbin mtight">+</span><span class="mord mtight"><span class="mord mathrm mtight">F</span><span class="mord mathrm mtight">N</span></span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">T</span><span class="mord mathrm mtight">P</span></span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.403331em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span>'
We updated Gitter to use the latest katex@0.10.0
, gitlab-org/gitter/webapp!1308
You can test it out on Gitter next/staging, https://next.gitter.im/ (part of Gitter 19.32.0)
If you see anything wrong, feel free to create an issue, https://gitlab.com/gitlab-org/gitter/webapp/issues
Hi, I'm trying to build KaTeX and it fails.
What I did is this:
git clone git@github.com:KaTeX/KaTeX.git
cd KaTeX/
npm install
npm run build
and the build output started as follows:
$ npm run build
> katex@0.10.1-pre build /home/username/KaTeX
> yarn prestart && rimraf dist/ && mkdirp dist && cp README.md dist && rollup -c && webpack
yarn run v1.13.0
$ yarn check && node src/unicodeMake.js
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
error "@babel/generator" is wrong version: expected "7.0.0", got "7.3.0"
error "@babel/helper-function-name" is wrong version: expected "7.0.0", got "7.1.0"
error "@babel/parser" is wrong version: expected "7.0.0", got "7.3.1"
...
The same failure occurs when I run yarn build
.
What am I doing wrong? I have node version v8.10.0, npm version 3.5.2, and yarn version 1.13.0. And current KaTeX commit is 7f778d1543fc1a9021609fa29067073658fb0d4b
.
This appears to work
$ pkg cli.js
> pkg@4.3.7
> Targets not specified. Assuming:
node10-linux-x64, node10-macos-x64, node10-win-x64
but then I get
$ ./cli-linux --help
KaTeX could not import, likely because dist/katex.js is missing.
Please run 'yarn' and 'yarn build' before running
cli.js from the KaTeX repository.
/snapshot/KaTeX/cli.js:18
throw e;
^
Error: Cannot find module './'
$ yarn build
yarn run v1.15.2
$ yarn prestart && rimraf dist/ && mkdirp dist && cp README.md dist && rollup -c && webpack
$ node src/unicodeMake.js
./katex.js → dist/katex.mjs...
[!] Error: Could not resolve '../submodules/katex-fonts/fontMetricsData' from src/macros.js
Error: Could not resolve '../submodules/katex-fonts/fontMetricsData' from src/macros.js
$ sh buildMetrics.sh
Traceback (most recent call last):
File "./extract_tfms.py", line 114, in <module>
main()
File "./extract_tfms.py", line 72, in main
font_path = find_font_path(font_name)
File "./extract_tfms.py", line 17, in find_font_path
raise RuntimeError("Couldn't find font metrics: '%s'" % font_name)
RuntimeError: Couldn't find font metrics: 'rsfs10.tfm'
pkg
. You might try changing the require("./")
to require("./katex.js")
or the path to the built files if that makes more sense for your purposes. To fix the issue with submodules see https://github.com/KaTeX/KaTeX/blob/master/CONTRIBUTING.md#working-with-submodules.
renderMathInElement(latexElementID,
{delimiters: [ // mind the order of delimiters(!?)
{left: "$", right: "$", display: true},
{left: "$", right: "$", display: false},
{left: "\\[", right: "\\]", display: true},
{left: "\\(", right: "\\)", display: false},
]}
);