Package org.opensourcephysics.display
Class TeXParser
java.lang.Object
org.opensourcephysics.display.TeXParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddSubscript(String root, String subscript) Adds a subscript to the root of an input String.static StringgetSubscript(String input) Gets the subscript from an input String.static StringConverts TeX-like notation for Greek symbols to unicode characters.static StringremoveSubscript(String input) Removes the subscript from an input String.static StringremoveSubscripting(String input) Removes subscripting notation from an input String.static Stringstatic String
-
Field Details
-
charMap
-
-
Constructor Details
-
TeXParser
public TeXParser()
-
-
Method Details
-
parseTeX
Converts TeX-like notation for Greek symbols to unicode characters.- Parameters:
s- the string in TeX-like notation- Returns:
-
toHTML
-
toHTML
-
removeSubscripting
Removes subscripting notation from an input String. This returns the root plus appended subscript but without subscripting notation.- Parameters:
input- the string with (possible) subscripting notation- Returns:
- the string without subscripting notation
-
removeSubscript
Removes the subscript from an input String. This returns the root only, with no subscript.- Parameters:
input- the string with (possible) subscript- Returns:
- the root
-
getSubscript
Gets the subscript from an input String.- Parameters:
input- the string with (possible) subscript- Returns:
- the subscript, or "" if none
-
addSubscript
Adds a subscript to the root of an input String.- Parameters:
root- the root to which the subscript will be addedsubscript- the subscript- Returns:
- the root with subscript in subscripting notation
-