Repository navigation
·
30 commits
to main
since this release
Where each marked piece is drawn, chemistry included: what a visual editor needs. And what the measured formulas still asked for: commands inside real formulas, and chemfig as its manual writes it.
What changed
- Inside real formulas.
\setlength{\arraycolsep}{…}spaces the columns of the arrays and matrices after it;\lefteqnoverlaps to the right in display style, as ineqnarray;\linebreak[n]is a break hint, as\allowbreak, and amsthm's\qedheredraws nothing, since an equation converted alone is not a proof. Measured on the 174,525 formulas: 39 more convert with no warning (the Stacks Project's\linebreak[0], arXiv's\qedhereand\arraycolsep), and none is drawn worse. - chemfig as its manual writes it. A branch may start with defaults of its own,
B([:60]-D-E),([::-30,1.5]-X-Y), valid in all of it;-#(d1,d2)(or\#,\CFhash) sets the space a bond leaves before the letters;**[30,330]5(…)draws the aromatic circle as an arc, dashed when its TikZ options say so. 17 more examples of the chemfig manual convert with no warning, and none is drawn worse. - Mechanisms and submolecules. A curved arrow of
\chemmovecan point at a bond,-[@{db,0.5}::30], and is read as the bond between its atoms;\definesubmol(with arguments and the dual[code1]{code2}) and!{name};\arrow(--name[yshift=5mm])moves the compound it brings. An unknown!{name}is drawn as written, as before, now with a warning that its definition is missing. - The rest of the measured formulas.
\noalign{\vspace{…}}and\vspaceinside a formula are read as the[length]of\\is, and\noalign{\hrule}is a rule; a\chemnamebreaks into lines at\\;\chemleft{[}takes its delimiter between braces; an arrow can leave a\subscheme's box; a\+right after an arrow is drawn (it was left out); a\chemmovepoint may carry its own move,([yshift=7pt]b1.180). What the 174,505 measured formulas still flag, 202 of them, is listed with the reason for each intools/coverage/REMAINING.md. - Marks inside chemistry. In
\ce, a mark around a piece (a species, its coefficient, formula or state, an arrow with its conditions) is read through: the piece is read as chemistry and the mark goes around it. In\chemfig, a mark around an atom's label is kept on the atom (bonds still reach the same letter), and a mark on a vertex without a label gives its point. Either way the drawing is the one without the marks, andboxessays where each piece is: what lets an editor edit reactions and structures piece by piece. In a scheme, a mark around an arrow's label keeps its text as text. - Where a structure's atoms and bonds are written. In the tree, each chemfig atom and bond has a
span: the characters of the structure's code it is written in (none after a submolecule rewrote the code). An editor changes one atom or bond in place with it. - Where each marked piece sits.
renderreturnsboxes: for each group marked with\htmlData,\htmlIdor\class, the box its content was set in, in the SVG's coordinates (left, top, width, height, baseline and nesting level). What a visual editor needs to place its cursor and read clicks over the SVG; marking draws exactly what the bare formula draws, as long as a marked operator keeps its class with\mathrel{…},\mathbin{…}(a group alone is an ordinary atom, as in TeX). In Rust,Output::boxesandItem::Group'sbounds, a change to the public API. &in a one-column environment.\begin{gather}a&b\end{gather}, and the same ingather*,gathered,multlineandmultline*, is refused in strict mode, as amsmath stops on it ("Misplaced alignment tab character &"); tolerant mode warns (E-REC-9) and joins the cells into the line, whichmultlinethen aligns as any other (#288). None of the 174,505 measured formulas changes.- Nemeth braille. A numeric subscript of a unit's letter takes no subscript indicator, as of any letter (§14.6):
\si{m}_1is ⠍⠂, asm_1; it was ⠍⠰⠂ (#287). - Nemeth braille.
\overleftarrow,\overleftrightarrowand their\under…forms are written as modified expressions with the arrow's full sign, ⠐⠭⠣⠫⠪⠒⠒⠻ (§22); they were the letter and ⠿ (#286). - CMU braille. An expression already in ( ), [ ] or { } written with plain signs no longer takes the auxiliary parentheses ⠢…⠔ as a radicand, numerator, denominator, exponent or index:
\sqrt{(a+b)}is ⠫⠱⠣⠁⠖⠃⠜, as\left(…\right)already was (§1.3);\sqrt{(a)+(b)}, two terms, keeps them (#285). - Fixes. A tikz-cd arrow with
from=starts at that cell and ends at the current one, unlessto=or a direction names the end, which count from the current cell as in tikz-cd:A & B \arrow[from=1-1]and\arrow[from=1-1, to=1-2]are an arrow from A to B (they were left out, as an arrow without a direction or to itself) (#284). - MathML. An
mlabeledtrwhose only cell is its label keeps the label, alone in its row; it was dropped, leaving an empty row (#283). - Fixes. In AsciiMath, a closing bracket where an argument or a script is expected (
sqrt),x^),frac(a))) leaves it empty, with a warning (E-REC-7, as a missing argument in LaTeX), and strict mode refuses it; it made the reader panic (#282).
Equations, drawn live on the project's evolution: \setlength{\arraycolsep}{2pt} \left[ \begin{array}{c|ccc} 0 & 1 & 1 & 2 \\ \hline 1 & 0 & 2 & 1 \end{array} \right] \chemfig{A-B([1]-X([4]-Z)-Y)(-[7]D)-C} \quad \chemfig{**[30,330]5(-----)} \htmlData{m=1}{x} \mathrel{\htmlData{m=2}{=}} \htmlData{m=3}{\frac{\htmlData{m=4}{a}}{\htmlData{m=5}{b}}}
Pull requests
Features
- feat(chem): chemfig branches with their own defaults, #(d1,d2) bond spacing and aromatic arcs by @matheusmota-dev-br in #276
- feat(chem): mechanism arrows to bonds, \definesubmol and compounds moved by their style by @matheusmota-dev-br in #277
- feat(tools): the coverage pipeline over real LaTeX, and an extraction that takes formulas only by @matheusmota-dev-br in #278
- feat(editor): @mathlabs/mathra-editor, a formula editor drawn by mathra by @matheusmota-dev-br in #280
- feat(editor): typing as on a calculator, matrices sized on a grid, chemistry written as math by @matheusmota-dev-br in #298
Bug fixes
- fix(latex): \setlength{\arraycolsep}, \lefteqn, \linebreak and \qedhere inside real formulas by @matheusmota-dev-br in #275
- fix: the rest of the measured formulas, and the list of what stays flagged and why by @matheusmota-dev-br in #279
- fix(asciimath): a closing bracket where an argument is expected is a missing argument, not a panic by @matheusmota-dev-br in #292
- fix(mathml): an mlabeledtr with only its label keeps the label by @matheusmota-dev-br in #289
- fix(latex): tikz-cd from= starts the arrow at that cell, with to= absolute by @matheusmota-dev-br in #291
- fix(braille): CMU leaves out the auxiliary parentheses around an expression already in brackets by @matheusmota-dev-br in #290
- fix(braille): Nemeth modifies an expression with a left arrow by @matheusmota-dev-br in #293
- fix(braille): Nemeth writes a numeric subscript of a unit without the indicator by @matheusmota-dev-br in #294
- fix(latex): & in multline, gather and gathered is refused in strict mode by @matheusmota-dev-br in #295
Documentation
- docs: the reference, the docs page and the README with what 1.11.0 brought, and text_kerning by @matheusmota-dev-br in #274
- docs: accessibility statement, issue templates and a pull request template by @matheusmota-dev-br in #297
Maintenance
- test: cover the workspace to 99.75% of lines, and a coverage floor in the checks by @matheusmota-dev-br in #281
- chore: every line and function of the workspace runs, and the checks hold it at 100% by @matheusmota-dev-br in #296
Install
| Package | Command | |
|---|---|---|
| Rust | mathra |
cargo add mathra@1.12.0 |
| CLI | mathra-cli |
cargo install mathra-cli@1.12.0 |
| npm | @mathlabs/mathra |
npm install @mathlabs/mathra@1.12.0 |
| Python | mathra |
pip install mathra==1.12.0 |
Full changelog: v1.11.0...v1.12.0