{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://paperspec.scient.ing/schemas/math.schema.json", "title": "Derived math", "description": "One line of derived/math.jsonl: a formula of the package read in the form scienting-math/1 by a pinned tool, its tree, symbol keys and issues; never authoritative; spec/09-figures-tables-equations.md §9.4, spec/12-package.md §12.7.", "$defs": { "kind": { "description": "What a tree node is. The kinds of scienting-math/1 are num, sym, text, const, oper, dots, empty, add, neg, pm, mp, mul, times, div, op, frac, binom, sqrt, root, pow, sub, prime, fact, prescript, mark, apply, lim, sum, prod, coprod, int, iint, iiint, oint, bigcup, bigcap, abs, norm, angle, floor, ceil, braces, interval, rel, list, lines, cases, matrix and opaque (spec/09 §9.4). The schema takes any lowercase name, so that a later minor version of the form may add a kind; a consumer that meets a kind it does not know treats that node as it treats opaque.", "type": "string", "pattern": "^[a-z][a-z0-9-]*$", "examples": [ "sym", "frac", "rel", "opaque" ] }, "node": { "description": "A tree node: an array whose first item is its kind and whose other items are its parts.", "type": "array", "minItems": 1, "prefixItems": [ { "$ref": "#/$defs/kind" } ], "items": { "$ref": "#/$defs/part" } }, "group": { "description": "Parts that are not a node: a case's value and condition, or a matrix's rows and cells. Its first item, when it has one, is a node, a group or null, never a string, so it is never mistaken for a node.", "type": "array", "prefixItems": [ { "anyOf": [ { "type": "array" }, { "type": "null" } ] } ], "items": { "$ref": "#/$defs/part" } }, "part": { "description": "A part of a node: a string (digits, a symbol key, words, a command, a relation such as =), null (a script or condition that is absent), a node, or a group.", "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/$defs/node" }, { "$ref": "#/$defs/group" } ] }, "issue": { "description": "Something a reader of the formula should look at; the formula is read all the same.", "type": "object", "properties": { "code": { "description": "unbalanced, unknown-command, label-or-power, script-on-group, opaque or infix-fraction in scienting-math/1 (spec/09 §9.4); a later minor version may add a code.", "type": "string", "pattern": "^[a-z][a-z0-9-]*$" }, "message": { "type": "string", "minLength": 1 }, "at": { "description": "The TeX the issue is about, in canonical form; empty when it is about the whole formula.", "type": "string" } }, "required": [ "code", "message", "at" ], "additionalProperties": false } }, "type": "object", "properties": { "node": { "$ref": "common.schema.json#/$defs/nodeId" }, "run": { "description": "The index of the math run in the node's runs, or null for an equation or equation-line node, as in derived/mathml.jsonl.", "anyOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "tool": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "version": { "type": "string", "minLength": 1 } }, "required": [ "name", "version" ], "additionalProperties": false }, "form": { "enum": [ "scienting-math/1" ] }, "tree": { "$ref": "#/$defs/node" }, "symbols": { "description": "The key of every symbol in the tree, each once, in the order the formula first writes it.", "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }, "complete": { "description": "True exactly when the tree has no opaque node.", "type": "boolean" }, "issues": { "type": "array", "items": { "$ref": "#/$defs/issue" } }, "label": { "description": "The printed number the tool lifted out of a \\tag in the source; omitted when the source has none.", "type": "string", "minLength": 1 } }, "required": [ "node", "run", "tool", "form", "tree", "symbols", "complete", "issues" ], "additionalProperties": false }