Package parsing

Class LatexReplacer

Object
LatexReplacer

public class LatexReplacer
extends Object
LatexReplacer contains tools regarding the use of LaTeX escapes. See method documentation for more details.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static Map<Pattern,​String> encodings
    Contains all encoding Patterns and their replacement characters
  • Method Summary

    Modifier and Type Method Description
    static String addEscapes​(String input)
    Adds LaTeX escapes to all operations that should be escaped, and to pi.
    static String encodeAll​(String input)
    Performs all of the methods in this class on the input according to the settings in Settings
    static String encodeMappings​(String input)
    Replaces LaTeX-escaped encodings in a string with their actual special characters, as long as they aren't followed by an allowed name character

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • encodings

      public static final Map<Pattern,​String> encodings
      Contains all encoding Patterns and their replacement characters
  • Method Details

    • encodeAll

      public static String encodeAll​(String input)
      Performs all of the methods in this class on the input according to the settings in Settings
      Parameters:
      input - the input to be encoded
      Returns:
      the encoded input
    • encodeMappings

      public static String encodeMappings​(String input)
      Replaces LaTeX-escaped encodings in a string with their actual special characters, as long as they aren't followed by an allowed name character
      Parameters:
      input - a LaTeX-escaped string
      Returns:
      the encoded string
    • addEscapes

      public static String addEscapes​(String input)
      Adds LaTeX escapes to all operations that should be escaped, and to pi.
      Parameters:
      input - the unescaped input
      Returns:
      the input with LaTeX escapes inserted as specified above