Top Description Fields Constructors Methods
uk.ac.ed.ph.snuggletex.utilities

public final Class SnuggleUtilities

extends Object
Class Inheritance
Imports
uk.ac.ed.ph.snuggletex.DOMOutputOptions, .SnuggleConstants, java.util.regex.Pattern, org.w3c.dom.Element

A collection of occasionally useful SnuggleTeX-related utility methods, as well as some more general LaTeX stuff.
Author
David McKain
Version
$Revision$

Field Summary

Modifier and TypeField and Description
private static final Pattern
private static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

SnuggleTeX encoding, or null if not present.
extractSnuggleTeXAnnotation
(Element mathmlElement)

Extracts a SnuggleTeX annotation from a MathML math element, if found.

public static String

Returns:

quoted text suitable for being input into LaTeX.
quoteTextForInput
(String
text to quote, assumed to be ASCII.
text
)

Quotes the given (ASCII) String so that it could be safely input in TEXT Mode in LaTeX input.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charsToBackslashPatternback to summary
private static final Pattern charsToBackslashPattern
charsToVerbPatternback to summary
private static final Pattern charsToVerbPattern

Constructor Detail

SnuggleUtilitiesback to summary
public SnuggleUtilities()

Method Detail

extractSnuggleTeXAnnotationback to summary
public static String extractSnuggleTeXAnnotation(Element mathmlElement)

Extracts a SnuggleTeX annotation from a MathML math element, if found. This allows you to extract the input LaTeX from a MathML element created by SnuggleTeX, provided that DOMOutputOptions#isAddingMathSourceAnnotations() returned true when the element was generated.

Returns:String

SnuggleTeX encoding, or null if not present.

quoteTextForInputback to summary
public static String quoteTextForInput(String text)

Quotes the given (ASCII) String so that it could be safely input in TEXT Mode in LaTeX input.

Parameters
text:String

text to quote, assumed to be ASCII.

Returns:String

quoted text suitable for being input into LaTeX.