diff --git a/README.md b/README.md index 764297d..817b793 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,18 @@ A small Java library to parse mathematical formulas to LaTeX and display them as images +Formula: ``` (a_1 / (b_1 + sqrt(c))^2) + sin(a_2 * b_2) ``` - +Image: ![example](example.png?raw=true) +LaTeX: +```latex +\left(\frac{{a}_{1}}{{\left({b}_{1}+\sqrt{c}\right)}^{2}}\right)+\sin{\left({a}_{2}\cdot {b}_{2}\right)} +``` + ## Installation Grab the latest release and add the `pretty-formula.jar` as well as all the dependencies from the `lib` directory to your project. diff --git a/src/de/uni_bielefeld/cebitec/mzurowie/pretty_formula/main/GUIWindow.java b/src/de/uni_bielefeld/cebitec/mzurowie/pretty_formula/main/GUIWindow.java index 1d779bf..c8f0207 100644 --- a/src/de/uni_bielefeld/cebitec/mzurowie/pretty_formula/main/GUIWindow.java +++ b/src/de/uni_bielefeld/cebitec/mzurowie/pretty_formula/main/GUIWindow.java @@ -119,6 +119,7 @@ private void jTextPane1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:eve try { BufferedImage image = FormulaParser.parseToImage(this.jTextPane1.getText()); + System.out.println(FormulaParser.parseToLatex(this.jTextPane1.getText())); this.jLabel2.getGraphics().drawImage(image, 0, 0, null); } catch (DetailedParseCancellationException e) {