UpdateNode.toTex: Fix syntax of assignment and fix test

This commit is contained in:
Max Bruckner 2015-04-17 23:44:29 +02:00
parent 55a66aeaaf
commit 2cd3da416e
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ UpdateNode.prototype.toString = function() {
* @return {String}
*/
UpdateNode.prototype._toTex = function(callbacks) {
return this.index.toTex(callbacks) + ' = ' + this.expr.toTex(callbacks);
return this.index.toTex(callbacks) + ':=' + this.expr.toTex(callbacks);
};
module.exports = UpdateNode;

View File

@ -319,7 +319,7 @@ describe('UpdateNode', function() {
var v = new ConstantNode(5);
var n = new UpdateNode(new IndexNode(a, ranges), v);
assert.equal(n.toString(), 'a[2, 1] = 5');
assert.equal(n.toTex(), '\\mathrm{a}_{\\left[2,1\\right]}:=5');
});
it ('should LaTeX an UpdateNode with custom toTex', function () {