/** * Creates a new {@link SnuggleSession} using the default {@link SessionConfiguration} * if se */ public SnuggleSession createSession() { SessionConfiguration sessionConfiguration = defaultSessionConfiguration; if (sessionConfiguration!=null) { sessionConfiguration = new SessionConfiguration(); } return createSession(sessionConfiguration); }
/** * Builds a DOM sub-tree based on the currently parsed tokens, appending the results as * children of the given target root Element. This uses the default {@link DOMOutputOptions} * associated with this engine. * * @return true if completed successfully, false if the process was terminated by an error in the * input LaTeX and if the session was configured to fail on the first error. */ public boolean buildDOMSubtree(final Element targetRoot) { return buildDOMSubtree(targetRoot, engine.getDefaultDOMOutputOptions()); }
/** * Creates {@link WebPageOutputOptions} suitable for creating an HTML 5 web page with * embedded MathML, using MathJax for cross-browser rendering of the MathML. * <p> * This is one of the most effective web page outputs. * * @see #createXHTMLMathJaxOptions() */ public static final WebPageOutputOptions createHTML5MathJaxOptions() { WebPageOutputOptions options = createHTML5Options(); options.setMathJax(true); return options; }
public static String formatErrorCodeName(ErrorCode errorCode) { String packageName = errorCode.getErrorGroup().getPackage().getName(); String errorCodeName = errorCode.getName(); return CorePackageDefinitions.CORE_PACKAGE_NAME.equals(packageName) ? errorCodeName : packageName + "/" + errorCodeName; }
/** * Creates a well-formed external general parsed entity out of the currently parsed tokens. * <p> * The default {@link XMLStringOutputOptions} specified in the {@link SnuggleEngine} will be * used. * * @return resulting XML if the process completed successfully, null if the process was * terminated by an error in the input LaTeX and if the session was configured to fail on * the first error. */ public String buildXMLString() { return buildXMLString(engine.getDefaultXMLStringOutputOptions()); }
public SnuggleSimpleMathRunner createSimpleMathRunner() { return new SnuggleSimpleMathRunner(createSession()); }
/** * Computes the appropriate "Content-Type" string to be specified * as an the XHTML <tt>meta</tt> element. * * @see #computeContentTypeHeader() */ private String computeMetaContentType() { return options.getContentType() + "; charset=" + options.getEncoding(); } }
protected Token(final FrozenSlice slice, final TokenType type, final LaTeXMode latexMode, final Interpretation... interpretations) { this.slice = slice; this.type = type; this.latexMode = latexMode; this.interpretationMap = SnugglePackage.makeInterpretationMap(interpretations); }
/** * Gets the {@link StylesheetManager} being used by the underlying {@link SnuggleEngine} */ public StylesheetManager getStylesheetManager() { return engine.getStylesheetManager(); }
public void addErrorCodes(ErrorCode... errorCodes) { for (ErrorCode errorCode : errorCodes) { addErrorCode(errorCode); } }
/** * Delegates to {@link SnuggleEngine#getBuiltinEnvironmentByTeXName(String)} * * @see SnuggleEngine#getBuiltinEnvironmentByTeXName(String) */ public BuiltinEnvironment getBuiltinEnvironmentByTeXName(String texName) { return engine.getBuiltinEnvironmentByTeXName(texName); }
public static String formatErrorCodeName(ErrorCode errorCode) { String packageName = errorCode.getErrorGroup().getPackage().getName(); String errorCodeName = errorCode.getName(); return CorePackageDefinitions.CORE_PACKAGE_NAME.equals(packageName) ? errorCodeName : packageName + "/" + errorCodeName; }
/** * Creates a new {@link SnuggleSession} using the default {@link SessionConfiguration} * if se */ public SnuggleSession createSession() { SessionConfiguration sessionConfiguration = defaultSessionConfiguration; if (sessionConfiguration!=null) { sessionConfiguration = new SessionConfiguration(); } return createSession(sessionConfiguration); }
/** * Builds a DOM sub-tree based on the currently parsed tokens, appending the results as * children of the given target root Element. This uses the default {@link DOMOutputOptions} * associated with this engine. * * @return true if completed successfully, false if the process was terminated by an error in the * input LaTeX and if the session was configured to fail on the first error. */ public boolean buildDOMSubtree(final Element targetRoot) { return buildDOMSubtree(targetRoot, engine.getDefaultDOMOutputOptions()); }
/** * Creates a well-formed external general parsed entity out of the currently parsed tokens. * <p> * The default {@link XMLStringOutputOptions} specified in the {@link SnuggleEngine} will be * used. * * @return resulting XML if the process completed successfully, null if the process was * terminated by an error in the input LaTeX and if the session was configured to fail on * the first error. */ public String buildXMLString() { return buildXMLString(engine.getDefaultXMLStringOutputOptions()); }
public SnuggleSimpleMathRunner createSimpleMathRunner(SessionConfiguration sessionConfiguration) { return new SnuggleSimpleMathRunner(createSession(sessionConfiguration)); }
protected Token(final FrozenSlice slice, final TokenType type, final LaTeXMode latexMode, final Interpretation... interpretations) { this.slice = slice; this.type = type; this.latexMode = latexMode; this.interpretationMap = SnugglePackage.makeInterpretationMap(interpretations); }
/** * Gets the {@link StylesheetManager} being used by the underlying {@link SnuggleEngine} */ public StylesheetManager getStylesheetManager() { return engine.getStylesheetManager(); }
public void addErrorCodes(ErrorCode... errorCodes) { for (ErrorCode errorCode : errorCodes) { addErrorCode(errorCode); } } }
public static String formatErrorCodeName(ErrorCode errorCode) { String packageName = errorCode.getErrorGroup().getPackage().getName(); String errorCodeName = errorCode.getName(); return CorePackageDefinitions.CORE_PACKAGE_NAME.equals(packageName) ? errorCodeName : packageName + "/" + errorCodeName; }