From b0f647792a9abfe94ea17221e557743f0667a286 Mon Sep 17 00:00:00 2001 From: gunnarmein-ts <86687645+gunnarmein-ts@users.noreply.github.com> Date: Tue, 24 Sep 2024 08:15:07 -0700 Subject: [PATCH] changes in ascii-math serialization for \choose and matrices (#2527) --- src/formats/atom-to-ascii-math.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/formats/atom-to-ascii-math.ts b/src/formats/atom-to-ascii-math.ts index 3d899d3af..18af766ed 100644 --- a/src/formats/atom-to-ascii-math.ts +++ b/src/formats/atom-to-ascii-math.ts @@ -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) { @@ -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 = {