UnicodeEmitter and HtmlEmitter, driven by ConversionTable.
Recoverable parse errors are handled inline: unknown commands (TTEC00) are reproduced from the
source per ConversionOptions., and stray _/^ in text mode (TTEM03)
render as _(...)/^(...). Any other parse error aborts via UnsupportedLatexException,
which the public API translates into returning the normalized input.
| Modifier and Type | Field and Description |
|---|---|
| private static final Map | MATH_ACCENT_ALIASES
Math-mode accent commands expressed as the table's short accent spellings. |
| protected final ConversionOptions | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static Optional | |
| protected abstract void | appendEmphasized(StringBuilder out, String renderedContent)
|
| protected abstract void | appendMathPassthrough(StringBuilder out, String source)
A math span emitted verbatim under |
| protected abstract void | appendPlain(StringBuilder out, String text)
Literal output text (converted characters, preserved commands, math characters). |
| protected abstract void | appendQuoted(StringBuilder out, String renderedContent)
|
| protected abstract void | appendScript(StringBuilder out, String renderedContent, boolean superscript)
A super-/subscript whose content was already rendered by a nested walk. |
| protected abstract void | appendText(StringBuilder out, String text, @Nullable ComputedStyle style)
A text run from the source, with the style SnuggleTeX computed for it ( |
| private static String | applyCombining(String base, String combining)
Inserts the combining mark after the base's first codepoint: the accent belongs to the
first letter even when the tokenizer hands over a longer run ( |
| public String | |
| private int | |
| private void | |
| private int | |
| private int | emitGenericCommand(List<FlowToken> tokens, int index, CommandToken command, String name, StringBuilder out)
|
| private int | emitToken(List<FlowToken> tokens, int index, StringBuilder out)
Emits the token at |
| private static String | fenceText(CharSequence source)
Normalizes a fence's source text ( |
| private static int | |
| private static boolean | |
| private static boolean | |
| protected static String | |
| protected abstract boolean | scriptsAsSource()
Whether scripts should be emitted as their verbatim source instead of converted
(the |
| private static int | |
| protected static Map | |
| protected String | |
| private String |
| MATH_ACCENT_ALIASES | back to summary |
|---|---|
| private static final Map<String, String> MATH_ACCENT_ALIASES Math-mode accent commands expressed as the table's short accent spellings. | |
| options | back to summary |
|---|---|
| protected final ConversionOptions options | |
| STYLE_MAP_CACHE | back to summary |
|---|---|
| private static final Map<String, Map<Integer, Integer>> STYLE_MAP_CACHE | |
| TokenWalker | back to summary |
|---|---|
| protected TokenWalker(ConversionOptions options) | |
| accentCombining | back to summary |
|---|---|
| private static Optional | |
| appendEmphasized | back to summary |
|---|---|
| protected abstract void appendEmphasized(StringBuilder out, String renderedContent)
| |
| appendMathPassthrough | back to summary |
|---|---|
| protected abstract void appendMathPassthrough(StringBuilder out, String source) A math span emitted verbatim under | |
| appendPlain | back to summary |
|---|---|
| protected abstract void appendPlain(StringBuilder out, String text) Literal output text (converted characters, preserved commands, math characters). | |
| appendQuoted | back to summary |
|---|---|
| protected abstract void appendQuoted(StringBuilder out, String renderedContent)
| |
| appendScript | back to summary |
|---|---|
| protected abstract void appendScript(StringBuilder out, String renderedContent, boolean superscript) A super-/subscript whose content was already rendered by a nested walk. | |
| appendText | back to summary |
|---|---|
| protected abstract void appendText(StringBuilder out, String text, @Nullable ComputedStyle style) A text run from the source, with the style SnuggleTeX computed for it ( | |
| applyCombining | back to summary |
|---|---|
| private static String applyCombining(String base, String combining) Inserts the combining mark after the base's first codepoint: the accent belongs to the
first letter even when the tokenizer hands over a longer run ( | |
| emit | back to summary |
|---|---|
| public String emit(SnuggleSession session) | |
| emitCommand | back to summary |
|---|---|
| private int emitCommand(List<FlowToken> tokens, int index, StringBuilder out) | |
| emitEnvironment | back to summary |
|---|---|
| private void emitEnvironment(EnvironmentToken environment, StringBuilder out) | |
| emitError | back to summary |
|---|---|
| private int emitError(List<FlowToken> tokens, int index, StringBuilder out) | |
| emitGenericCommand | back to summary |
|---|---|
| private int emitGenericCommand(List<FlowToken> tokens, int index, CommandToken command, String name, StringBuilder out) | |
| emitToken | back to summary |
|---|---|
| private int emitToken(List<FlowToken> tokens, int index, StringBuilder out) Emits the token at | |
| fenceText | back to summary |
|---|---|
| private static String fenceText(CharSequence source) Normalizes a fence's source text ( | |
| findBalancedClose | back to summary |
|---|---|
| private static int findBalancedClose(WorkingDocument document, int openIndex) | |
| hasArgument | back to summary |
|---|---|
| private static boolean hasArgument(CommandToken command, int argumentIndex) | |
| hasWhitespaceGap | back to summary |
|---|---|
| private static boolean hasWhitespaceGap(FlowToken previous, FlowToken current) | |
| mapThroughStyle | back to summary |
|---|---|
| protected static String mapThroughStyle(String text, String styleCommandName) | |
| scriptsAsSource | back to summary |
|---|---|
| protected abstract boolean scriptsAsSource() Whether scripts should be emitted as their verbatim source instead of converted
(the | |
| skipTokensBefore | back to summary |
|---|---|
| private static int skipTokensBefore(List<FlowToken> tokens, int index, int documentEnd) | |
| styleMap | back to summary |
|---|---|
| protected static Map | |
| walk | back to summary |
|---|---|
| protected String walk(List<FlowToken> tokens) | |
| walkArgument | back to summary |
|---|---|
| private String walkArgument(CommandToken command, int argumentIndex) | |