Top Description Fields Constructors Methods
org.jabref.model.strings

public Class LatexToUnicodeAdapter

extends Object
Class Inheritance
Imports
java.text.Normalizer, java.util.Objects, .Optional, java.util.regex.Pattern, com.github.tomtung.latex2unicode.LaTeX2Unicode, fastparse.Parsed

Adapter class for the latex2unicode lib. This is an alternative to our LatexToUnicode class

Field Summary

Modifier and TypeField and Description
private static final String
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:

a String with LaTeX resolved into Unicode, or the original String if the LaTeX could not be parsed
format
(String
a String containing LaTeX
inField
)

Attempts to resolve all LaTeX in the String.

public static Optional<String>

Returns:

an Optional<String> with LaTeX resolved into Unicode or empty on failure.
parse
(String
a String containing LaTeX
inField
)

Attempts to resolve all LaTeX in the String.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

REPLACEMENT_CHARback to summary
private static final String REPLACEMENT_CHAR
UNDERSCORE_MATCHERback to summary
private static final Pattern UNDERSCORE_MATCHER
UNDERSCORE_PLACEHOLDER_MATCHERback to summary
private static final Pattern UNDERSCORE_PLACEHOLDER_MATCHER

Constructor Detail

LatexToUnicodeAdapterback to summary
public LatexToUnicodeAdapter()

Method Detail

formatback to summary
public static String format(String inField)

Attempts to resolve all LaTeX in the String.

Parameters
inField:String

a String containing LaTeX

Returns:String

a String with LaTeX resolved into Unicode, or the original String if the LaTeX could not be parsed

parseback to summary
public static Optional<String> parse(String inField)

Attempts to resolve all LaTeX in the String.

Parameters
inField:String

a String containing LaTeX

Returns:Optional<String>

an Optional<String> with LaTeX resolved into Unicode or empty on failure.