Top Description Constructors Methods
org.jabref.latexconv.internal

public final Class UnicodeToLatexConverter

extends Object
Class Inheritance
Imports
java.text.Normalizer, java.util.Optional

Encodes Unicode plain text as LaTeX, the reverse of UnicodeEmitter, from the same conversion table.

Differences from JabRef's historical UnicodeToLatexFormatter: characters without a mapping are kept as-is instead of being dropped, command emissions are wrapped in a single brace group ({\aa}, not {{\aa}}), and runs of Unicode super-/subscript characters merge into one \textsuperscript{...}/\textsubscript{...} so the conversion round-trips (JabRef issue #3644).

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
accentForm(int[] codePoints, int baseIndex, int marks)

public static String
private static int
countMappedMarks(int[] codePoints, int start)

Number of consecutive codepoints from start that are combining marks with a known accent command.

private static int
emitScriptRun(int[] codePoints, int start, StringBuilder out, boolean superscript)

private static String
wrap(String latex, int codePoint)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnicodeToLatexConverterback to summary
private UnicodeToLatexConverter()

Method Detail

accentFormback to summary
private static String accentForm(int[] codePoints, int baseIndex, int marks)
convertback to summary
public static String convert(String text)
countMappedMarksback to summary
private static int countMappedMarks(int[] codePoints, int start)

Number of consecutive codepoints from start that are combining marks with a known accent command. Zero when the very first is unknown — the caller then falls back to emitting characters individually.

emitScriptRunback to summary
private static int emitScriptRun(int[] codePoints, int start, StringBuilder out, boolean superscript)
wrapback to summary
private static String wrap(String latex, int codePoint)