Skip to content

Commit

Permalink
Added LaTeX output to example.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzur committed Dec 4, 2014
1 parent 6b32743 commit 131082c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 131082c

Please sign in to comment.