Skip to content

Commit

Permalink
changes in ascii-math serialization for \choose and matrices (#2527)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmein-ts authored Sep 24, 2024
1 parent c6019f6 commit b0f6477
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/formats/atom-to-ascii-math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,12 @@ export function atomToAsciiMath(
result += atomToAsciiMath(genfracAtom.below, options);
result += ')';
} else {
// No bar line, i.e. \choose, etc...
result += '(' + atomToAsciiMath(genfracAtom.above, options) + '),';
result += '(' + atomToAsciiMath(genfracAtom.below, options) + ')';
// No bar line, for \choose
result += '((';
result += atomToAsciiMath(genfracAtom.above, options);
result += ') choose (';
result += atomToAsciiMath(genfracAtom.below, options);
result += '))';
}

if (genfracAtom.leftDelim || genfracAtom.rightDelim) {
Expand Down Expand Up @@ -372,12 +375,8 @@ export function atomToAsciiMath(
const rows: string[] = [];
for (const row of array) {
const cells: string[] = [];
for (const cell of row)
cells.push(
rowDelim[0] + atomToAsciiMath(cell, options) + rowDelim[1]
);

rows.push(cells.join(','));
for (const cell of row) cells.push(atomToAsciiMath(cell, options));
rows.push(rowDelim[0] + cells.join(',') + rowDelim[1]);
}

const delim = {
Expand Down

0 comments on commit b0f6477

Please sign in to comment.