Skip to content

Commit b5773df

Browse files
authored
fix: nthRoots latexFunctions template string (#3427)
1 parent 8d8ea98 commit b5773df

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/utils/latex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const latexFunctions = {
143143
2: undefined // use default template
144144
},
145145
nthRoot: { 2: '\\sqrt[${args[1]}]{${args[0]}}' },
146-
nthRoots: { 2: '\\{y : $y^{args[1]} = {${args[0]}}\\}' },
146+
nthRoots: { 2: '\\{y : y^${args[1]} = {${args[0]}}\\}' },
147147
pow: { 2: `\\left(\${args[0]}\\right)${latexOperators.pow}{\${args[1]}}` },
148148
round: {
149149
1: '\\left\\lfloor${args[0]}\\right\\rceil',

test/unit-tests/expression/node/FunctionNode.test.js

+3
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ describe('FunctionNode', function () {
519519
const o = new OperatorNode('+', 'add', [c1, c2])
520520
const n3 = new FunctionNode(new SymbolNode('permutations'), [o])
521521
assert.strictEqual(n3.toTex(), '\\mathrm{permutations}\\left(4+5\\right)')
522+
523+
const n4 = new FunctionNode(new SymbolNode('nthRoots'), [c1, c2])
524+
assert.strictEqual(n4.toTex(), '\\{y : y^5 = {4}\\}')
522525
})
523526

524527
it('should have an identifier', function () {

0 commit comments

Comments
 (0)