Skip to content

Commit

Permalink
Update README after changed rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
korsbo committed Nov 26, 2017
1 parent da87338 commit cf53951
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,30 @@ as well as arrays of any supported types.

Latexify.jl supplies a few functions:
- `latexraw`, a function that all other eventually uses. This latexifies objects and returns a string which does not contain a surrounding `\LaTeX` environment.
- `latexify`, calls `latexraw` but converts the output to a LaTeXString which is automatically rendered in Jupyter or Hydrogen, and which surrounds the output string with $$.
- 'latexalign', generates a latex align environment.
- 'latexarray', generates a latex array.
- `latexify`, calls `latexraw` but converts the output to a LaTeXString which is automatically rendered in Jupyter or Hydrogen, and which surrounds the output string with \$ \$.
- `latexalign`, generates a latex align environment.
- `latexarray`, generates a latex array.

### Examples
#### latexifying expressions
```julia
julia> using Latexify
julia> ex = :(x/(y+x)^2)
julia> latexstring = latexify(ex)
julia> print(latexstring)
using Latexify
ex = :(x/(y+x)^2)
latexstring = latexify(ex)
print(latexstring)
```
results in:
```LaTeX
\frac{x}{(y+x)^{2}}
$\frac{x}{(y+x)^{2}}$
```

#### latexifying strings
```julia-repl
julia> using Latexify
julia> print(latexraw("x+y/(b-2)^2"))
```julia
using Latexify
print(latexraw("x+y/(b-2)^2"))
```
outputs:
```LaTeX
x + \frac{y}{\left( b - 2 \right)^{2}}
```

Expand Down Expand Up @@ -70,7 +73,14 @@ outputs:

This can be useful for lazy people, like me, who don't want to type out equations.
But if you use Jupyter (or Atom with Hydrogen), it can also be useful to get a more clear view of your equations.
By using a string type supplied by [LaTeXStrings.jl](https://github.com/stevengj/LaTeXStrings.jl) the output of all functions except `latexraw` is automatically rendered. I cannot demonstrate this in the README, since github markdown does not support rendering, but for some examples you can see the [docs](https://korsbo.github.io/Latexify.jl/stable).
Since the package uses a string type supplied by [LaTeXStrings.jl](https://github.com/stevengj/LaTeXStrings.jl) the output of all functions except `latexraw` is automatically rendered.
This can also be enforced by

```julia
display(latexify(f))
```

I cannot demonstrate this in the README, since github markdown does not support rendering, but for some examples you can see the [docs](https://korsbo.github.io/Latexify.jl/stable).


## Installation
Expand Down

0 comments on commit cf53951

Please sign in to comment.