/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream}, which is closed afterwards. * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * * @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 writeWebPage(final WebPageOutputOptions options, final OutputStream outputStream) throws IOException { return writeWebPage(options, null, outputStream, EndOutputAction.CLOSE); }
/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream}, which is closed afterwards. * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * * @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 writeWebPage(final WebPageOutputOptions options, final OutputStream outputStream) throws IOException { return writeWebPage(options, null, outputStream, EndOutputAction.CLOSE); }
/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream}, which is closed afterwards. * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * * @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 writeWebPage(final WebPageOutputOptions options, final OutputStream outputStream) throws IOException { return writeWebPage(options, null, outputStream, EndOutputAction.CLOSE); }
/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream} and performing the given {@link EndOutputAction} to * it afterwards (i.e. close, flush or do nothing). * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * * @since 1.2.2 * * @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 writeWebPage(final WebPageOutputOptions options, final OutputStream outputStream, final EndOutputAction endOutputAction) throws IOException { return writeWebPage(options, null, outputStream, endOutputAction); }
/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream} and performing the given {@link EndOutputAction} to * it afterwards (i.e. close, flush or do nothing). * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * * @since 1.2.2 * * @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 writeWebPage(final WebPageOutputOptions options, final OutputStream outputStream, final EndOutputAction endOutputAction) throws IOException { return writeWebPage(options, null, outputStream, endOutputAction); }
/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream} and performing the given {@link EndOutputAction} to * it afterwards (i.e. close, flush or do nothing). * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * * @since 1.2.2 * * @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 writeWebPage(final WebPageOutputOptions options, final OutputStream outputStream, final EndOutputAction endOutputAction) throws IOException { return writeWebPage(options, null, outputStream, endOutputAction); }
/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream}, which is closed afterwards. * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * <p> * If the <tt>contentTypeSettable</tt> Object has a * property called <tt>contentType</tt>, then it is set in advance to the appropriate HTTP * <tt>Content-Type</tt> header for the resulting page before the web page data is written. * * @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. * * @throws IOException if an I/O problem arose whilst writing out the web page data. * @throws SnuggleRuntimeException if calling <tt>setContentType()</tt> on the contentTypeSettable * Object failed, with the underlying Exception wrapped up. */ public boolean writeWebPage(final WebPageOutputOptions options, final Object contentTypeSettable, final OutputStream outputStream) throws IOException { return writeWebPage(options, contentTypeSettable, outputStream, EndOutputAction.CLOSE); }
/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream}, which is closed afterwards. * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * <p> * If the <tt>contentTypeSettable</tt> Object has a * property called <tt>contentType</tt>, then it is set in advance to the appropriate HTTP * <tt>Content-Type</tt> header for the resulting page before the web page data is written. * * @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. * * @throws IOException if an I/O problem arose whilst writing out the web page data. * @throws SnuggleRuntimeException if calling <tt>setContentType()</tt> on the contentTypeSettable * Object failed, with the underlying Exception wrapped up. */ public boolean writeWebPage(final WebPageOutputOptions options, final Object contentTypeSettable, final OutputStream outputStream) throws IOException { return writeWebPage(options, contentTypeSettable, outputStream, EndOutputAction.CLOSE); }
/** * Builds a complete web page based on the currently parsed tokens, sending the results * to the given {@link OutputStream}, which is closed afterwards. * <p> * The provided {@link WebPageOutputOptions} Object is * used to determine which type of web page to generate and how it should be configured. * <p> * If the <tt>contentTypeSettable</tt> Object has a * property called <tt>contentType</tt>, then it is set in advance to the appropriate HTTP * <tt>Content-Type</tt> header for the resulting page before the web page data is written. * * @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. * * @throws IOException if an I/O problem arose whilst writing out the web page data. * @throws SnuggleRuntimeException if calling <tt>setContentType()</tt> on the contentTypeSettable * Object failed, with the underlying Exception wrapped up. */ public boolean writeWebPage(final WebPageOutputOptions options, final Object contentTypeSettable, final OutputStream outputStream) throws IOException { return writeWebPage(options, contentTypeSettable, outputStream, EndOutputAction.CLOSE); }
session.writeWebPage(snuggleOptions, System.out, EndOutputAction.FLUSH);
session.writeWebPage(snuggleOptions, System.out, EndOutputAction.FLUSH);
session.writeWebPage(snuggleOptions, System.out, EndOutputAction.FLUSH);
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("$$ e^{i\\pi} = -1 $$"); session.parseInput(input); /* Create "options" Object to SnuggleTeX what kind of web page we want. We're going * to generate one that will work fine with MOZILLA and tweak a few options, just for * fun! */ WebPageOutputOptions options = WebPageOutputOptionsTemplates.createWebPageOptions(WebPageType.MOZILLA); options.setTitle("My Web Page"); options.setAddingTitleHeading(true); options.setIndenting(true); options.setAddingMathSourceAnnotations(true); options.setIncludingStyleElement(false); /* Now ask SnuggleTeX to write the resulting output to the console. * (You would normally send the output somewhere more interesting, though!) */ session.writeWebPage(options, System.out); } }
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("$$ e^{i\\pi} = -1 $$"); session.parseInput(input); /* Create "options" Object to SnuggleTeX what kind of web page we want. We're going * to generate one that will work fine with MOZILLA and tweak a few options, just for * fun! */ WebPageOutputOptions options = WebPageOutputOptionsTemplates.createWebPageOptions(WebPageType.MOZILLA); options.setTitle("My Web Page"); options.setAddingTitleHeading(true); options.setIndenting(true); options.setAddingMathSourceAnnotations(true); options.setIncludingStyleElement(false); /* Now ask SnuggleTeX to write the resulting output to the console. * (You would normally send the output somewhere more interesting, though!) */ session.writeWebPage(options, System.out); } }
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("$$ a^2 = b^2 + c^2 $$"); session.parseInput(input); /* Create "options" Object to SnuggleTeX what kind of web page we want. We're going * to generate one that will work fine with MOZILLA and tweak a few options, just for * fun! */ WebPageOutputOptions options = WebPageOutputOptionsBuilder.createHTML5MathJaxOptions(); options.setTitle("My Web Page"); options.setAddingTitleHeading(true); options.setIndenting(true); options.setAddingMathSourceAnnotations(true); options.setIncludingStyleElement(false); /* Now ask SnuggleTeX to write the resulting output to the console. * (You would normally send the output somewhere more interesting, though!) */ session.writeWebPage(options, System.out); } }