# GenTeX.jl

For most situations, I would advise to use Franklin.jl which has great build in support for pre-rendering LaTeX equations. If you want to use real LaTeX, then the most important function is `substitute_latex`

.

`GenTeX.substitute_latex`

— Function`substitute_latex(md::AbstractString, scale::Number, im_dir; extra_packages="")::String`

Substitute LaTeX in Markdown string `md`

. The LaTeX images will be placed at `im_dir/<h>.svg`

where `h`

is a hash calculated over the math expression. Tweaking the image size is possible by setting `scale`

.

The benefit of using a hash is that the browser downloads only one image per math expression.

It substitutes LaTeX as HTML in Markdown strings. Note that GenTeX can only support alignment and scaling on Markdown parsers with support for raw HTML. This is not supported by Julia's Markdown parser.

## Simple example

Below is a simple example in Julia Markdown.

```
using GenTeX
tmpdir = tempname() * '/'
mkdir(tmpdir)
md = substitute_latex(raw"$u$ and $v$", 1, tmpdir)
rm(tmpdir, recursive=true)
md
```