Methods
checkIfEqual(leftside, rightside, dsList)
Parameters:
Name | Type | Description |
---|---|---|
leftside |
string | left side of equation |
rightside |
string | right side of equation |
dsList |
array | list of definition sets to be considered |
- Source:
- See:
Returns:
true if a = b, false if not
assembles an equation a = b from left side a uns right side b, then checks if a = b is true
assembles an equation a = b from left side a uns right side b, then checks if a = b is true
checkIfEquality(equation, dsList)
Parameters:
Name | Type | Description |
---|---|---|
equation |
string | TEX string representing an equation to be checked |
dsList |
array | array of definition sets to be considered |
- Source:
- See:
Returns:
true if equality holds, false if not
deleteSpaceAndRemoveBackslash(text) → {string}
deletes spaces and removes backslashes before 'min' or 'max'
Parameters:
Name | Type | Description |
---|---|---|
text |
string | latex string to be parsed |
- Source:
Returns:
beautified latex string
- Type
- string
Examples
text = 'abc def' returns 'abc def'
A backslash \ has to be escaped as \\ in regex expressions and javascript strings
text = '\min' returns 'min'
text = '\cdot' (no trailing space) returns '\cdot ' (1 space)
text = '\cdot ' (2 spaces) returns '\cdot ' (1 space)
separateInputfield(latex) → {object}
Parameters:
Name | Type | Description |
---|---|---|
latex |
string | string containing latex code |
- Source:
Returns:
object consisting of three strings: before, tag, after
- Type
- object
Examples
result = separateInputfield("bli\\class{inputfield}{bla}blu"), then
result.before = "bli", result.tag = "bla", result.after = "blu"
result = separateInputfield("string_without_inputfield"), then
result.before = "", result.tag = "", result.after = "string_without_inputfield"
unifyDefinitions(def) → {Array.<string>}
decomposes a definition string into a list of definitions
Parameters:
Name | Type | Description |
---|---|---|
def |
string | definition sets, composed with & or && |
- Source:
Returns:
array of string expressions with condition to be positive
- Type
- Array.<string>
Example
def="x > 0 && y < 5" returns ["x", "5-y"], meaning x > 0 and 5-y > 0