notesy::tex

Math macros every note's formulas can use, as a manifest's [math] adds them, but from code: made from a setting, say, or changed as it runs. Needs nothing.

rustuse notesy::{settings, tex};

pub fn ready() {
    tex::define("R", "\\mathbb{R}");
    tex::define("abs", "\\left|#1\\right|");
    // One a setting names: $\field$ in a note is the field it's set to.
    tex::define("field", settings::get("field"));
}
Function What it does
tex::define(name, body) \name stands for body in every formula, #1 to #9 its arguments; defining it again changes it. A name is letters only (a \ before it or not), and body is 1 to 512 characters.
tex::remove(name) takes away one it defined

A script defines at most 64, and they go when it stops. One it defines wins over its manifest's of the same name, and a note's own math-macros wins over both.

Every page