Skip to content
Snippets Groups Projects
Commit 37822a91 authored by David Werner's avatar David Werner
Browse files

improved offline mathjax with npm

parent be155b3e
No related branches found
No related tags found
1 merge request!236Shell-script which formats all the README.md with pandoc and latex from the...
Pipeline #47894 waiting for manual action with stage
......@@ -655,13 +655,29 @@ function install_katex() {
function install_mathjax() {
local targetdir=$1
local mode=2
if test ! -f $targetdir/MathJax.js
then
# wget -q -O ${targetdir}/MathJax.js "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js"
echo "Downloading MathJax.js."
wget -q -O ${targetdir}/MathJax.js "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full"
ln -sf ${targetdir}/MathJax.js .
case $mode in
1)
# wget -q -O ${targetdir}/MathJax.js "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js"
echo "Downloading MathJax.js."
wget -q -O ${targetdir}/MathJax.js "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full"
ln -sf ${targetdir}/MathJax.js .
;;
2)
pushd ${targetdir}
# https://docs.mathjax.org/en/latest/web/hosting.html#web-hosting
# prebuild components in node_modules/mathjax/es5
if test ! -f node_modules/mathjax/es5/tex-chtml.js; then
npm install mathjax@3
fi
popd
;;
esac
fi
}
......@@ -707,7 +723,8 @@ function make_html() {
mathjax_reveal)
install_mathjax $targetdir
pathmathjax='file:./MathJax.js'
#DW pathmathjax='file:./MathJax.js'
pathmathjax='file:./node_modules/mathjax/es5/tex-chtml.js'
# pathreveal=https://unpkg.com/reveal.js/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment