We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca0c7da commit 463f79cCopy full SHA for 463f79c
1 file changed
src/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.ts
@@ -232,6 +232,14 @@ export const DEFINITIONS_LINEAR_ALGEBRA: LatexDictionary = [
232
kind: 'function',
233
latexTrigger: '\\tr',
234
arguments: 'implicit',
235
+ serialize: (serializer: Serializer, expr: Expression): string => {
236
+ const arg = operand(expr, 1);
237
+ const argLatex = serializer.serialize(arg);
238
+ // Use \tr A for simple args, \tr\left(...\right) for complex ones
239
+ if (typeof arg === 'string' || typeof arg === 'number')
240
+ return `\\tr ${argLatex}`;
241
+ return `\\tr\\left(${argLatex}\\right)`;
242
+ },
243
},
244
245
// Also support plain text: tr(A)
0 commit comments