initial switch to latexmlmath, per #5

This commit is contained in:
Alexander 2025-07-01 19:25:02 -04:00
parent 38d8d44b00
commit 376c0f5f93
8 changed files with 20 additions and 6 deletions

1
.gitignore vendored
View file

@ -8,3 +8,4 @@ woff2/
**/serve_*
/lexers.out
fonts/*trial
**/*.log

1
acl.cool/math_wrapper.sh Symbolic link
View file

@ -0,0 +1 @@
../math_wrapper.sh

View file

@ -1,6 +1,6 @@
#! /usr/bin/env nix-shell
#! nix-shell --pure -i bash
#! nix-shell --pure -p nodejs_24 bash harfbuzz soupault woff2 jotdown python3 recode nodePackages_latest.katex minify
#! nix-shell --pure -p nodejs_24 bash harfbuzz soupault woff2 jotdown python3 recode perl538Packages.LaTeXML minify
if ! [[ -d pgvv/ ]]; then
python3 -m venv pgvv

View file

@ -245,8 +245,8 @@ code, pre code {
font-size: calc(0.84 * var(--base-font-size));
}
/* for STIX 2 */
math {
color: black;
font-family: "Math";
font-size: calc(0.96 * var(--base-font-size));
}

View file

@ -189,7 +189,7 @@ math[display="block"] {
position: relative;
left: 0;
right: auto;
text-align: left;
text-align: center;
}
footer {

11
math_wrapper.sh Executable file
View file

@ -0,0 +1,11 @@
#! /usr/bin/env sh
if [ $# -lt 1 ]; then
echo -n '<strong>BLOCK MATH ERROR</strong>'
elif [[ "$1" == "display" ]]; then
echo -n '<p>'
latexmlmath --preload=amsmath.sty --preload=amssymb.sty -
echo -n '</p>'
else
latexmlmath --preload=amsmath.sty --preload=amssymb.sty -
fi

View file

@ -132,11 +132,11 @@ command = "./syntax_wrapper.sh ${ATTR_CLASS##*-}"
[widgets.math-inline]
widget = "preprocess_element"
selector = "span.math.inline"
command = "sed -E 's/^\\\\\\((.*)\\\\\\)$/\\1/' | katex --format mathml"
command = "./math_wrapper.sh inline"
action = "replace_element"
[widgets.math-display]
widget = "preprocess_element"
selector = "span.math.display"
command = "sed -E 's/^\\\\\\[(.*)\\\\\\]$/\\1/' | katex -d --fleqn --format mathml | awk '{print \"<p>\" $0 \"</p>\"}'"
command = "./math_wrapper.sh display"
action = "replace_element"

View file

@ -0,0 +1 @@
../math_wrapper.sh