@@ -0,0 +1,2351 @@
+/*%0A * Copyright (c) 2017 J%C3%A9r%C3%A9mie DECOCK (http://www.jdhp.org)%0A */%0A%0Aimport org.eclipse.swt.SWT;%0Aimport org.eclipse.swt.SWTError;%0Aimport org.eclipse.swt.browser.Browser;%0Aimport org.eclipse.swt.layout.GridData;%0Aimport org.eclipse.swt.layout.GridLayout;%0Aimport org.eclipse.swt.widgets.Display;%0Aimport org.eclipse.swt.widgets.Shell;%0A%0A%0Apublic class BrowserHTMLWithMathJax %7B%0A%0A    public static final String html = %22%3C!DOCTYPE html%3E%5Cn%22%0A        + %22%3Chtml%3E%5Cn%22%0A        + %22%3Chead%3E%5Cn%22%0A        + %22    %3Cmeta charset=%5C%22UTF-8%5C%22%3E%5Cn%22%0A        + %22    %3Cscript type=%5C%22text/x-mathjax-config%5C%22%3E%5Cn%22%0A        + %22        MathJax.Hub.Config(%7B%5Cn%22%0A        + %22            tex2jax: %7BinlineMath: %5B%5B%5C%22$%5C%22,%5C%22$%5C%22%5D,%5B%5C%22%5C%5C%5C%5C(%5C%22,%5C%22%5C%5C%5C%5C)%5C%22%5D%5D%7D%5Cn%22%0A        + %22        %7D);%5Cn%22%0A        + %22    %3C/script%3E%5Cn%22%0A        + %22    %3C!-- Install MathJax on Debian: %5C%22aptitude install libjs-mathjax%5C%22 --%3E%5Cn%22%0A        + %22    %3Cscript type=%5C%22text/javascript%5C%22 src='/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS_HTML-full'%3E%3C/script%3E%5Cn%22%0A        + %22%3C/head%3E%5Cn%22%0A        + %22%3Cbody%3E%5Cn%22%0A        + %22    %3Cp%3E%5Cn%22%0A        + %22        When $a %5C%5Cne 0$, there are two solutions to %5C%5C(ax%5E2 + bx + c = 0%5C%5C) and they are%5Cn%22%0A        + %22        $$x = %7B-b %5C%5Cpm %5C%5Csqrt%7Bb%5E2-4ac%7D %5C%5Cover 2a%7D.$$%5Cn%22%0A        + %22    %3C/p%3E%5Cn%22%0A        + %22%3C/body%3E%5Cn%22%0A        + %22%3C/html%3E%22;%0A%0A    public static void main(String %5B%5D args) %7B%0A        // Display the HTML code%0A        System.out.println(html);%0A%0A        // SWT%0A        Display display = new Display();%0A%0A        // Make the window%0A        Shell shell = new Shell(display);%0A        shell.setLayout(new GridLayout(1, false));%0A%0A        // Add a widget%0A        Browser browser;%0A        try %7B%0A            //browser = new Browser(shell, SWT.NONE);       // default%0A            //browser = new Browser(shell, SWT.MOZILLA);  // force mozilla%0A            browser = new Browser(shell, SWT.WEBKIT);   // force webkit%0A        %7D catch (SWTError e) %7B%0A            System.out.println(%22Could not instantiate Browser: %22 + e.getMessage());%0A            display.dispose();%0A            return;%0A        %7D%0A        browser.setLayoutData(new GridData(GridData.FILL_BOTH));%0A        browser.setText(html);%0A%0A        // Render the window%0A        shell.open();%0A%0A        while(!shell.isDisposed()) %7B%0A            if(!display.readAndDispatch()) %7B%0A                display.sleep();%0A            %7D%0A        %7D%0A%0A        display.dispose();%0A    %7D%0A%7D%0A

Add a snippet.