/** * 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(defaultXMLStringOutputOptions); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The given {@link DOMOutputOptions} Object is used to configure the process. * * @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. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead. */ @Deprecated public String buildXMLString(final DOMOutputOptions options) { return buildXMLString(options, false); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The given {@link DOMOutputOptions} Object is used to configure the process. * * @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. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead. */ @Deprecated public String buildXMLString(final DOMOutputOptions options) { return buildXMLString(options, false); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The given {@link DOMOutputOptions} Object is used to configure the process. * * @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. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead. */ @Deprecated public String buildXMLString(final DOMOutputOptions options) { return buildXMLString(options, false); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The default {@link DOMOutputOptions} specified in the {@link SnuggleEngine} will be * used. * * @param indent whether to indent the resulting XML or not * * @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. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead */ @Deprecated public String buildXMLString(boolean indent) { return buildXMLString(defaultDOMOutputOptions, indent); }
/** * 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()); }
/** * 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()); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The default {@link DOMOutputOptions} specified in the {@link SnuggleEngine} will be * used. * * @param indent whether to indent the resulting XML or not * * @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. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead */ @Deprecated public String buildXMLString(boolean indent) { return buildXMLString(engine.getDefaultDOMOutputOptions(), indent); }
/** * Convenience method to create a well-formed external general parsed entity out of the * currently parsed tokens. * <p> * The default {@link DOMOutputOptions} specified in the {@link SnuggleEngine} will be * used. * * @param indent whether to indent the resulting XML or not * * @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. * * @deprecated Use {@link #buildXMLString(XMLStringOutputOptions)} instead */ @Deprecated public String buildXMLString(boolean indent) { return buildXMLString(engine.getDefaultDOMOutputOptions(), indent); }
public static void main(String[] args) throws IOException { /* Create vanilla SnuggleEngine and new SnuggleSession */ SnuggleEngine engine = new SnuggleEngine(); SnuggleSession session = engine.createSession(); /* Parse some very basic Math Mode input */ SnuggleInput input = new SnuggleInput("$$ x+2=3 $$"); session.parseInput(input); /* Convert the results to an XML String, which in this case will * be a single MathML <math>...</math> element. */ String xmlString = session.buildXMLString(); System.out.println("Input " + input.getString() + " was converted to:\n" + xmlString); } }
public static void main(String[] args) throws IOException { /* Create vanilla SnuggleEngine and new SnuggleSession */ SnuggleEngine engine = new SnuggleEngine(); SnuggleSession session = engine.createSession(); /* Parse some very basic Math Mode input */ SnuggleInput input = new SnuggleInput("$$ x+2=3 $$"); session.parseInput(input); /* Convert the results to an XML String, which in this case will * be a single MathML <math>...</math> element. */ String xmlString = session.buildXMLString(); System.out.println("Input " + input.getString() + " was converted to:\n" + xmlString); } }
public static void main(String[] args) throws IOException { /* Create vanilla SnuggleEngine and new SnuggleSession */ SnuggleEngine engine = new SnuggleEngine(); SnuggleSession session = engine.createSession(); /* Parse some very basic Math Mode input */ SnuggleInput input = new SnuggleInput("$$ x+2=3 $$"); session.parseInput(input); /* Convert the results to an XML String, which in this case will * be a single MathML <math>...</math> element. */ String xmlString = session.buildXMLString(); System.out.println("Input " + input.getString() + " was converted to:\n" + xmlString); } }
System.out.println(session.buildXMLString(snuggleOptions));
System.out.println(session.buildXMLString(snuggleOptions));
System.out.println(session.buildXMLString(snuggleOptions));
public static void main(String[] args) throws IOException { /* Create vanilla SnuggleEngine and new SnuggleSession */ SnuggleEngine engine = new SnuggleEngine(); SnuggleSession session = engine.createSession(); /* Parse some LaTeX input */ SnuggleInput input = new SnuggleInput("\\section*{The quadratic formula}" + "$$ \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a} $$"); session.parseInput(input); /* Specify how we want the resulting XML */ XMLStringOutputOptions options = new XMLStringOutputOptions(); options.setSerializationMethod(SerializationMethod.XHTML); options.setIndenting(true); options.setEncoding("UTF-8"); options.setAddingMathSourceAnnotations(true); options.setUsingNamedEntities(true); /* (Only used if caller has an XSLT 2.0 processor) */ /* Convert the results to an XML String, which in this case will * be a single MathML <math>...</math> element. */ System.out.println(session.buildXMLString(options)); } }
public static void main(String[] args) throws IOException { /* Create vanilla SnuggleEngine and new SnuggleSession */ SnuggleEngine engine = new SnuggleEngine(); SnuggleSession session = engine.createSession(); /* Parse some LaTeX input */ SnuggleInput input = new SnuggleInput("\\section*{The quadratic formula}" + "$$ \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a} $$"); session.parseInput(input); /* Specify how we want the resulting XML */ XMLStringOutputOptions options = new XMLStringOutputOptions(); options.setSerializationMethod(SerializationMethod.XHTML); options.setIndenting(true); options.setEncoding("UTF-8"); options.setAddingMathSourceAnnotations(true); if (engine.getStylesheetManager().supportsXSLT20()) { /* Caller has an XSLT 2.0 processor, so let's output named entities for readability */ options.setUsingNamedEntities(true); } /* Convert the results to an XML String, which in this case will * be a single MathML <math>...</math> element. */ System.out.println(session.buildXMLString(options)); } }
public static void main(String[] args) throws IOException { /* Create vanilla SnuggleEngine and new SnuggleSession */ SnuggleEngine engine = new SnuggleEngine(); SnuggleSession session = engine.createSession(); /* Parse some LaTeX input */ SnuggleInput input = new SnuggleInput("\\section*{The quadratic formula}" + "$$ \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a} $$"); session.parseInput(input); /* Specify how we want the resulting XML */ XMLStringOutputOptions options = new XMLStringOutputOptions(); options.setSerializationMethod(SerializationMethod.XHTML); options.setIndenting(true); options.setEncoding("UTF-8"); options.setAddingMathSourceAnnotations(true); if (engine.getStylesheetManager().supportsXSLT20()) { /* Caller has an XSLT 2.0 processor, so let's output named entities for readability */ options.setUsingNamedEntities(true); } /* Convert the results to an XML String, which in this case will * be a single MathML <math>...</math> element. */ System.out.println(session.buildXMLString(options)); } }