Class TeXParser

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

public class TeXParser extends Object
  • Field Details

  • Constructor Details

    • TeXParser

      public TeXParser()
  • Method Details

    • parseTeX

      public static String parseTeX(String s)
      Converts TeX-like notation for Greek symbols to unicode characters.
      Parameters:
      s - the string in TeX-like notation
      Returns:
    • toHTML

      public static String toHTML(String s)
    • toHTML

      public static String toHTML(String s, String tex, String html)
    • removeSubscripting

      public static String removeSubscripting(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 String removeSubscript(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 String getSubscript(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 String addSubscript(String root, 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