Tools to deal with xparse argument signatures. (E.g., "o m" for optional followed by mandatory
argument).
If you are working on the internals of unified-latex.
npm install @unified-latex/unified-latex-util-argspec
This package contains both esm and commonjs exports. To explicitly access the esm export,
import the .js file. To explicitly access the commonjs export, import the .cjs file.
parse(str)Parse an xparse argument specification string to an AST.
This function caches results. Don't mutate the returned AST!
function parse(str: String): ArgSpec.Node[];
Parameters
| Param | Type | Description |
|---|---|---|
| str | String |
* LaTeX string input |
printRaw(node, root)Print an xparse argument specification AST
to a string.
function printRaw(
node: string | ArgSpec.Node | (string | ArgSpec.Node)[],
root: Boolean
): string;
Parameters
| Param | Type |
|---|---|
| node | Omitted |
| root | Boolean |
Generated using TypeDoc