Rewrite Rulesbase/dots-to-ldots-or-cdots

base/dots-to-ldots-or-cdots

Resolve plain \dots to an explicit ellipsis only when the following math atom class determines MathJax's choice.

Rewrite patterns#

  1. following-non-bin-rel\dots #1\ldots #1
  2. following-bin-rel\dots #1\cdots #1

Examples#

Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.

Following non bin rel#

Before

a,\dots,b

After this rule

a,\ldots,b

Rendering verified with the declared packages.

Following bin rel#

Before

a\dots=b

After this rule

a\cdots=b

Rendering verified with the declared packages.

Right boundary preserved#

Before

x+\dots

After this rule

x+\dots

Rendering verified with the declared packages.

Same family#

Notes#

MathJax BaseItems.DotsItem selects cdots only when the next embellished core atom has Bin or Rel TeX class; otherwise it selects ldots. The rule must inspect AST siblings and known character/command records, skip missing or unclassifiable following atoms, and leave \dotsb/\dotsc/\dotsi/\dotsm/\dotso to their existing owners. It is a partial matcher and therefore touches rather than eliminates cmd:dots. Every Applied result replaces one eligible cmd:dots node with ldots or cdots; missing and unclassifiable following atoms return Skipped, so the number of eligible cmd:dots nodes strictly decreases.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["base/dots-to-ldots-or-cdots"])
new TransformEngine({ profile: 'corpus', disableRules: ['base/dots-to-ldots-or-cdots'] })

Open in Playground