Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

katex: copy-paste support for Latex code, upgraded to katex 0.16.0 #54

Merged
merged 13 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions assets/javascripts/initializers/discourse-math-katex.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ function ensureKaTeX() {
return loadScript("/plugins/discourse-math/katex/katex.min.js").then(() => {
return loadScript("/plugins/discourse-math/katex/katex.min.css", {
css: true,
}).then(() => {
return loadScript("/plugins/discourse-math/katex/mhchem.min.js");
});
})
.then(() => {
return loadScript("/plugins/discourse-math/katex/mhchem.min.js");
})
.then(() => {
return loadScript("/plugins/discourse-math/katex/copy-tex.min.js");
});
});
}

Expand Down
3 changes: 2 additions & 1 deletion public/katex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

```bash
DMPATH=/path/to/discourse-math # set this to your path to the discourse-math repo
cd /tmp
wget -O- https://github.com/KaTeX/KaTeX/releases/latest/download/katex.tar.gz | tar -zx
cp katex/fonts/*.woff* $DMPATH/public/katex/fonts/
cp katex/katex.min.* katex/contrib/mhchem.min.js $DMPATH/public/katex/
cp katex/katex.min.* katex/contrib/{mhchem,copy-tex}.min.js $DMPATH/public/katex/
sed -i "s~url(fonts/~url(/plugins/discourse-math/katex/fonts/~g" $DMPATH/public/katex/katex.min.css
```

Expand Down
1 change: 1 addition & 0 deletions public/katex/copy-tex.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/katex/katex.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/katex/katex.min.js

Large diffs are not rendered by default.