Max Bruckner
250707b668
Convert the isNode function into a boolean property.
2015-04-28 09:56:01 +02:00
Max Bruckner
390a0060b4
Add is<NameOfNode> property to enable type checking across constructors
2015-04-28 09:14:53 +02:00
Max Bruckner
e62ab0dae4
Proper toTex for units and symbols.
...
Symbols now don't use `\mathrm` anymore by default, but units do.
2015-04-27 11:08:31 +02:00
Max Bruckner
ca4a0bfda4
Change LaTeX output of string function
...
toTex shouldn't do operations like toString on the node tree
2015-04-27 10:09:42 +02:00
jos
d3d3212633
Refactored all nodes into factory functions (see #342 )
2015-04-26 21:25:31 +02:00
Max Bruckner
8ad525b66e
util/latex: get rid of many unnecessary curly braces
2015-04-19 11:08:00 +02:00
Max Bruckner
9c606c044f
latex.toSymbol: get rid of unnecessary curly braces and wire up units
2015-04-19 09:56:40 +02:00
Max Bruckner
ee4486c3df
SymbolNode.toTex: Prevent symbols from breaking operators
...
If a symbol comes after an operator like '\cdot', there needs to be a
space in between, otherwise the cdot won't get recognized by the LaTeX
parser.
2015-04-19 09:49:10 +02:00
Max Bruckner
1c73dc1262
ConstantNode.toTex: simplify exponential notatian and add test
2015-04-19 09:49:09 +02:00
Max Bruckner
2cd3da416e
UpdateNode.toTex: Fix syntax of assignment and fix test
2015-04-19 09:49:09 +02:00
Max Bruckner
55a66aeaaf
OperatorNode.toTex: get rid of unnecessary curly braces
2015-04-19 09:49:09 +02:00
Max Bruckner
753a0e7893
IndexNode.toTex: Bugfix: execute toTex on Range Arguments
...
Also changes the Layout of the LaTeX output of IndexNode.
2015-04-19 09:49:08 +02:00
Max Bruckner
978bc2bc31
FunctionAssignmentNode.toTex: get rid of unnecessary curly braces
2015-04-19 09:49:08 +02:00
Max Bruckner
816b6314a7
AssignmentNode.toTex: get rid of unnecessary curly braces
2015-04-19 02:13:27 +02:00
Max Bruckner
8db07e23ad
OperatorNode.toTex: BUGFIX: make clear where the exponent belongs to
...
Without proper parentheses it's impossible to decide whether an exponent
belongs to the numerator of a fraction or to the entire fraction.
For ConditionalNode, the exponent is hard to see without parentheses.
2015-04-19 02:11:20 +02:00
Max Bruckner
f2bcfed89f
LaTeX: no spaces between operands and operators
2015-04-17 14:18:24 +02:00
Max Bruckner
7c1c9c0cef
Show less unnecessary parentheses in LaTeX output
...
OperatorNodes with exponentiation, fractions and conditions use less
parentheses.
2015-04-16 22:31:02 +02:00
Jos de Jong
bc6f63b6c9
Merge pull request #318 from FSMaxB/latex-restructure
...
Restructure and complete the LaTeX generator.
2015-04-13 09:39:16 +02:00
jos
3150e21c8e
Fixed #313 : parsed functions did not handle recursive calls correctly
2015-04-09 20:29:51 +02:00
Max Bruckner
dacf9fba46
OperatorNode: bugfix: toTex creates invalid LaTeX
...
toTex has been creating invalid LaTeX for fractions where the operands
are in parenthesis, see '(1+1)/2' for example
2015-04-05 14:29:15 +02:00
Max Bruckner
0868987cdf
util/latex: use ":=" for assignments and '=' 'equal'
2015-04-05 14:29:14 +02:00
Max Bruckner
6b1d09f2cb
util/latex: new toSymbol
2015-04-05 14:29:12 +02:00
Max Bruckner
5dcb87aeaa
util/latex: Remove unused functions
...
* toArgs
* addBraces
* dots and curly functions
util/latex.js: Remove Function addBraces
util/latex.js remove dots and curly functions
2015-04-05 14:29:09 +02:00
Max Bruckner
13e35217b7
Latex restructure
2015-04-05 14:25:54 +02:00
Max Bruckner
47f76f35ac
Limit custom toTex with multiple callbacks to FunctionNodes
...
Now only FunctionNode's toTex can be overwritten mit a map of callbacks
2015-03-17 18:14:14 +01:00
Max Bruckner
af763aa996
Fix breaking change (Node.toTex should return an empty string)
2015-03-13 21:23:14 +01:00
Max Bruckner
0fee9173c8
Enable custom toTex functions
2015-03-13 21:23:14 +01:00
Max Bruckner
35ce7f7fb4
Make Node.toTex a wrapper like Node.compile
...
Node.prototype.toTex is now a wrapper that calls the node's _toTex
2015-03-13 21:23:14 +01:00
Max Bruckner
6a9c2df38c
Update FunctionAssignmentNode to better handle parenthesis
2015-03-01 17:10:09 +01:00
Max Bruckner
bb2bfc939c
Update AssignmentNode to better handle parenthesis
2015-03-01 17:02:42 +01:00
Max Bruckner
b2d868c2ed
Update OperatorNode's toTex to better handle parens
...
Use the new infrastructure in OperatorNode's toTex
2015-03-01 16:34:09 +01:00
Max Bruckner
b5ce799e9d
New generic toString for AssignmentNode
2015-03-01 10:35:04 +01:00
Max Bruckner
1f2f42012c
New generic toString for FunctionAssignmentNode
2015-03-01 10:35:04 +01:00
Max Bruckner
b1a438fd7f
New generic toString for RangeNode
2015-03-01 10:35:03 +01:00
Max Bruckner
9489fbf9dc
New generic toString for ConditionalNode
2015-03-01 10:35:03 +01:00
Max Bruckner
1ac3319656
OperatorNode: validate input
2015-03-01 10:35:03 +01:00
Max Bruckner
0e5a6e5a38
New generic toString for OperatorNode
2015-03-01 10:35:03 +01:00
Max Bruckner
d593e749e9
New function getIdentifier() for Nodes
...
getIdentifier() returns a String that contains the name of the node and
the function associated with it ( in case of FunctionNode and
OperatorNode ).
2015-03-01 10:35:03 +01:00
Max Bruckner
e587f0ce00
New tests for Operator mode
...
* Factorial of Operator node
* Test unaryMinus with sums and differences
* Test OperatorNode that substracts an OperatorNode
2015-02-14 16:31:05 +01:00
jos
3d84b47658
Fixed #258 : missing parentheses in the toTex representation of function permutations.
2015-01-03 10:29:55 +01:00
jos
309bf3938d
Added proper error messages to Node.map
2014-11-15 13:32:02 +01:00
jos
9257ec3c33
Added unit tests for Node.map and Node.forEach
2014-11-15 13:16:32 +01:00
jos
5669ae1365
Some refactoring
2014-11-14 11:35:13 +01:00
jos
a1f60db0d1
Created Node.map, changed traverse to use Node.map
2014-11-14 11:25:48 +01:00
jos
20c96894ab
Enforcing implementation of _traverse on Nodes
2014-11-13 22:16:57 +01:00
jos
be9a8629ea
Node.transform does not create a clone of the tree anymore
2014-11-13 22:01:48 +01:00
jos
92627f2c94
Nodes for a BlockNode must now be passed via the constructor instead of via a function add
2014-11-13 21:54:41 +01:00
jos
423909e6f1
Changed constructor of RangeNode to new RangeNode(start: Node, end: Node [, step: Node]).
2014-11-13 21:25:37 +01:00
jos
72a1b03850
Documented expression tree API. Some internal refactoring in nodes.
2014-11-12 22:30:15 +01:00
jos
7132a6f3c2
Fixed #221 for one-based implementations of map and forEach
2014-10-14 09:03:04 +02:00