Class EquationFunction

  • The EquationFunction represents a function within a mathematical Equation element in Google Docs.

  • It can contain other EquationFunctions, EquationFunctionArgumentSeparators, EquationSymbols, and Text elements.

  • The methods available allow for manipulating the element's content, searching within it, accessing its properties, and managing its position within the document structure.

  • You can clear the contents, copy the element, edit its content as text, find specific elements or text within it, and get/set its attributes and link URL.

  • Methods also exist to retrieve child and sibling elements, get the number of children, access the parent element, and remove the element from its parent.

EquationFunction

An element representing a function in a mathematical Equation. An EquationFunction may contain EquationFunction, EquationFunctionArgumentSeparator, EquationSymbol, and Text elements. For more information on document structure, see the guide to extending Google Docs.

Methods

MethodReturn typeBrief description
clear()EquationFunctionClears the contents of the element.
copy()EquationFunctionReturns a detached, deep copy of the current element.
editAsText()TextObtains a Text version of the current element, for editing.
findElement(elementType)RangeElement|nullSearches the contents of the element for a descendant of the specified type.
findElement(elementType, from)RangeElement|nullSearches the contents of the element for a descendant of the specified type, starting from the specified RangeElement.
findText(searchPattern)RangeElement|nullSearches the contents of the element for the specified text pattern using regular expressions.
findText(searchPattern, from)RangeElement|nullSearches the contents of the element for the specified text pattern, starting from a given search result.
getAttributes()ObjectRetrieves the element's attributes.
getChild(childIndex)ElementRetrieves the child element at the specified child index.
getChildIndex(child)IntegerRetrieves the child index for the specified child element.
getCode()StringRetrieves the code corresponding to the equation function.
getLinkUrl()String|nullRetrieves the link url.
getNextSibling()Element|nullRetrieves the element's next sibling element.
getNumChildren()IntegerRetrieves the number of children.
getParent()ContainerElement|nullRetrieves the element's parent element.
getPreviousSibling()Element|nullRetrieves the element's previous sibling element.
getText()StringRetrieves the contents of the element as a text string.
getTextAlignment()TextAlignment|nullGets the text alignment.
getType()ElementTypeRetrieves the element's ElementType.
isAtDocumentEnd()BooleanDetermines whether the element is at the end of the Document.
merge()EquationFunction|nullMerges the element with the preceding sibling of the same type.
removeFromParent()EquationFunction|nullRemoves the element from its parent.
replaceText(searchPattern, replacement)ElementReplaces all occurrences of a given text pattern with a given replacement string, using regular expressions.
setAttributes(attributes)EquationFunctionSets the element's attributes.
setLinkUrl(url)