TrialAndErrorOrg/parsers

Clean up delimiter picking for math env

Opened this issue · 0 comments

Clean up delimiter picking for math env

https://github.com/JournalOfTrialAndError/JOTE/blob/8611ac9a411c8603513b9ad20bbbb6e9cbcd1a89/libs/ltast-util-to-latex/src/lib/handle/inline-math.ts#L13

  options: Options = {}
) => {
  const builtInDelimiters =
    node.delimiters === '()' ? ['\\(', '\\)'] : ['$', '$']
  console.log(node.delimiters)

  // TODO: Clean up delimiter picking for math env
  const delimiters = options.inlineMathDelimiters
    ? options.inlineMathDelimiters === '()'
      ? ['\\(', '\\)']
      : ['$', '$']
    : builtInDelimiters
  const [left, right] = delimiters
  return ` ${left} ${toLatex(node.children)} ${right} `
}

48d21aea7cc09e01d09c08543b7f46ebb96f29b2