org.opensourcephysics.display
Class TeXParser

java.lang.Object
  extended by org.opensourcephysics.display.TeXParser

public class TeXParser
extends java.lang.Object


Field Summary
static java.util.Map<java.lang.String,java.lang.String> charMap
           
 
Constructor Summary
TeXParser()
           
 
Method Summary
static java.lang.String addSubscript(java.lang.String root, java.lang.String subscript)
          Adds a subscript to the root of an input String.
static java.lang.String getSubscript(java.lang.String input)
          Gets the subscript from an input String.
static java.lang.String parseTeX(java.lang.String inputStr)
          Converts TeX-like notation for Greek symbols to unicode characters.
static java.lang.String removeSubscript(java.lang.String input)
          Removes the subscript from an input String.
static java.lang.String removeSubscripting(java.lang.String input)
          Removes subscripting notation from an input String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

charMap

public static java.util.Map<java.lang.String,java.lang.String> charMap
Constructor Detail

TeXParser

public TeXParser()
Method Detail

parseTeX

public static java.lang.String parseTeX(java.lang.String inputStr)
Converts TeX-like notation for Greek symbols to unicode characters.

Parameters:
inputStr - the string in TeX-like notation
Returns:

removeSubscripting

public static java.lang.String removeSubscripting(java.lang.String input)
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

public static java.lang.String removeSubscript(java.lang.String input)
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

public static java.lang.String getSubscript(java.lang.String input)
Gets the subscript from an input String.

Parameters:
input - the string with (possible) subscript
Returns:
the subscript, or "" if none

addSubscript

public static java.lang.String addSubscript(java.lang.String root,
                                            java.lang.String subscript)
Adds a subscript to the root of an input String.

Parameters:
root - the root to which the subscript will be added
subscript - the subscript
Returns:
the root with subscript in subscripting notation