Rewrite patterns#
- degree
\root #1 \of #2\sqrt[#1]{#2} - empty-degree
\root\of #1\sqrt[]{#1}
Examples#
Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.
Compound root#
Rendering verified with the declared packages.
Related rules#
Same family#
ams/cfrac-to-fracDrop continued-fraction styling from centered AMS cfrac forms.ams/dbinom-and-tbinom-to-binomRewrite AMS display-style and text-style binomial commands to binom.ams/dfrac-to-fracRewrite the AMS display-style fraction command to frac.ams/tfrac-to-fracRewrite the AMS text-style fraction command to frac.base/above-to-genfracRewrite above to a thickness-preserving genfrac form.base/abovewithdelims-to-genfracRewrite abovewithdelims to an explicit genfrac with delimiters and thickness.base/atop-to-genfracRewrite infix atop to an explicit no-rule genfrac form.base/atopwithdelims-to-genfracRewrite atopwithdelims to an explicit delimited no-rule genfrac form.base/brace-to-genfracRewrite infix brace to an explicit genfrac with brace delimiters.base/brack-to-genfracRewrite infix brack to an explicit genfrac with bracket delimiters.base/choose-to-binomRewrite infix choose to an explicit binom command.base/over-to-fracRewrite infix over to an explicit frac command.base/overwithdelims-to-genfracRewrite overwithdelims to an explicit genfrac with delimiters.base/leftroot-dropDrop the leftroot index-position hint in cleanup-oriented normalization.base/uproot-dropDrop the uproot index-position hint in cleanup-oriented normalization.
Notes#
Consume the two parser-owned argument slots from root argspec u{\of} m: a mathematical degree terminated by \of, followed by one radicand argument. The degree may be empty or contain unbraced scripts and nested groups. As for a TeX delimited parameter, a degree that is exactly one braced group loses that brace layer at parse time, so \root{1+2}\of x and \root 1+2\of x are the same AST. The \of terminator is ArgumentKind::Until delimiter metadata, not a sibling Command node, so touches is empty. Preserve outer scripts and trailing radicand siblings.
Disable this rule#
TransformEngine(profile="corpus", disable_rules=["base/root-of-to-sqrt"])new TransformEngine({ profile: 'corpus', disableRules: ['base/root-of-to-sqrt'] })