Methods
add_symbol(name, symbol, templateopt)
Add a symbol to this instance of the editor.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | param |
|
symbol |
Object | If |
|
template |
string |
<optional> |
The name of the template to use. |
backspace()
Simulate the "backspace" key press
delete_key()
Simulate the "delete" key press
done()
Execute the "done" callback
down()
Simulate a down arrow key press
end()
Move the cursor to the end of the document
get_content(t)
Get the content of the editor
Parameters:
Name | Type | Description |
---|---|---|
t |
string | The type of content to render ("latex", "text", or "xml"). |
home()
Move the cursor to the beginning of the document
insert_doc(doc)
Insert a copy of the given document into the editor at the current cursor position.
Parameters:
Name | Type | Description |
---|---|---|
doc |
Doc | The document to insert. |
insert_string(s)
Insert a string into the document at the current cursor position.
Parameters:
Name | Type | Description |
---|---|---|
s |
string | The string to insert. |
insert_symbol(sym_name)
Insert a symbol into the document at the current cursor position.
Parameters:
Name | Type | Description |
---|---|---|
sym_name |
string | The name of the symbol to insert. Should match one of the keys in the symbols JSON object |
left()
Simulate the left arrow key press
list_extend(direction, copy)
Add an element to a list (or row/column to a matrix) in the specified direction. Can optionally copy the current element/row/column to the new one.
Parameters:
Name | Type | Description |
---|---|---|
direction |
string | One of |
copy |
boolean | Whether or not to copy the current element/row/column into the new one. |
list_remove()
Remove the current element from a list (or column from a matrix)
list_remove_col()
Remove the current column from a matrix
list_remove_row()
Remove the current row from a matrix
list_vertical_move(down)
Move the cursor by one row up or down in a matrix.
Parameters:
Name | Type | Description |
---|---|---|
down |
boolean | If |
redo()
Redo the last undone action
remove_symbol(name)
Remove a symbol from this instance of the editor.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the symbol to remove. |
right()
Simulate the right arrow key press
sel_all()
Select the entire contents of the editor.
sel_clear()
Clear the current selection, leaving the document unchanged and nothing selected.
sel_copy()
Copy the current selection, leaving the document unchanged but placing the contents of the current selection on the clipboard.
sel_cut()
Cut the current selection, removing it from the document and placing it in the clipboard.
sel_delete()
Delete the current selection.
sel_left()
Move the cursor to the left, adjusting the selection along with the cursor.
sel_paste()
Paste the current contents of the clipboard.
sel_right(name)
function
Parameters:
Name | Type | Description |
---|---|---|
name |
string | param |
set_content(xml_data)
Set the XML content of the editor
Parameters:
Name | Type | Description |
---|---|---|
xml_data |
string | An XML string of the content to place in the editor |
set_doc(doc)
Set the document of the editor
Parameters:
Name | Type | Description |
---|---|---|
doc |
Doc | The Doc that will be the editor's source |
spacebar()
Simulate the spacebar key press
tab()
Simulate a tab key press
undo()
Undo the last action
up()
Simulate an up arrow key press