Skip to content

Commit

Permalink
Added support for :equation-label on an mtd in the first column as …
Browse files Browse the repository at this point in the history
…an alternative to `mlabeledtr`.

Also, `mlabeledtr` wasn't consolodating the `mtd`s into a single `mrow`.
  • Loading branch information
NSoiffer committed Feb 21, 2025
1 parent 21c0fc9 commit 515cf84
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion Rules/Intent/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,43 @@
children:
- x: "*"

-
# merge all the mtd into a single mtd
name: consolidate-labeled-mtd-entries
tag: [mlabeledtr, mtr]
# Note: child hasn't been processed, so 'intent' hasn't been processed/turned into data-intent-property
match: "count(*) > 1 and
($TableProperty = 'piecewise' or $TableProperty = 'system-of-equations' or $TableProperty = 'lines') and
(self::m:mlabeledtr or *[1][contains(@intent, ':equation-label')])"
replace:
- intent:
name: "mlabeledtr"
children:
- x: "*[1]"
- intent:
name: "mtd"
attrs: "id='*[2]/@id'"
children:
- intent:
name: "mrow"
attrs: "id='*[2]/*[1]/@id'"
children: [x: "*[position()>1]/*"]

-
# convert a mtr to a mlabeledtr
name: mlabeledtr
tag: mtr
# Note: child hasn't been processed, so 'intent' hasn't been processed/turned into data-intent-property
match: "count(*) > 1 and *[1][contains(@intent, ':equation-label')]"
replace:
- intent:
name: "mlabeledtr"
children: [x: "*"]

-
# merge all the mtd into a single mtd
name: consolidate-mtd-entries
tag: mtr # Fix: add support for mlabeledtr
tag: mtr
match: "count(*) > 1 and
($TableProperty = 'piecewise' or $TableProperty = 'system-of-equations' or $TableProperty = 'lines')"
replace:
Expand Down

0 comments on commit 515cf84

Please sign in to comment.