Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luavreis/xparsejax
MathJax extension providing xparse definitions
https://github.com/luavreis/xparsejax
Last synced: 3 months ago
JSON representation
MathJax extension providing xparse definitions
- Host: GitHub
- URL: https://github.com/luavreis/xparsejax
- Owner: luavreis
- Created: 2023-05-13T19:08:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-16T13:30:47.000Z (5 months ago)
- Last Synced: 2024-09-24T15:03:14.070Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# xparsejax
This is a simple implementation of LaTeX `xparse` package for MathJax. Currently it provides three family of commands:
- `NewDocumentCommand` (also `Renew...`, `Provide...` and `Declare...` variants as aliases);
- `IfBooleanTF` (also `T` and `F` variants);
- `IfNoValueTF` (also `T` and `F` variants).Supported argument type specifiers are:
- `m`: mandatory argument;
- `o`: optional argument;
- `O⟨default⟩`: optional argument with default;
- `s`: optional star;
- `t⟨token⟩`: optional token.Please refer to `xparse` documentation on CTAN for more information about the commands.
Note that `NewDocumentEnviroment` is not implemented but should not be hard to do so. There are also many other argument types that could be implemented with varying degrees of difficulty.
## Usage
There is a packed minified version under [`browser`](browser). You can serve it under your website (say, at `/path/to/xparsejax.js`) and load it in your MathJax configuration like so:
```js
MathJax = {
loader: {
load: ['[xparsejax]/xparsejax.js'],
paths: {xparsejax: '/path/to'} // specify your path here
},
tex: {
packages: {'[+]': ['xparsejax']},
},
[... other stuff ...]
}
```To compile it yourself, you should have both `node` and `pnpm` installed. Then it should suffice to do:
```sh
cd xparsejax
npm install
npm run build
```