From 6a4a7e4e0d44c21c20644d7059a13429dfb3d90a Mon Sep 17 00:00:00 2001 From: gunnarmein-ts Date: Mon, 23 Sep 2024 10:58:08 -0700 Subject: [PATCH] changes in ascii-math serialization for \choose and matrices --- 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 = {