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},
]}
);