## LaTeX for Slideshow

This package provides a way to use LaTeX code directly in Slideshow.

 (require (planet stchang/slideshow-tex))

### 1Requirements

This package requires the following to be installed:

• LaTeX

• an updated geometry.sty that includes \newgeometry. Check here to download an updated geometry.sty and for install directions.

• ImageMagick

### 2How to Use

 procedure(tex str ...) → pict? str : string?
Converts input LaTeX code into pict for use in Slideshow.

Conversion steps:

1) Input strings inserted into LaTeX document (in math mode) and compiled to pdf.

(Temporary files are created in the directory <tmpdir>/slideshow-texfiles/ where <tmpdir> is the result of (find-system-path temp-dir). Temporary files are named texfile<#>.<ext> where <#> is the equal-hash-code of the input string and <ext> is the appropriate extension (ie, tex, aux, etc.).)

2) pdf file converted to png file using ImageMagick.

(All temporary files, except png files, are deleted after the conversion is done.)

3) Slideshow pict returned using bitmap.

Results of compilation (ie, the png files) are cached. This function first checks for an existing png file (identified with the equal-hash-code hash) and uses instead of recompiling every time.

Example:

 > (tex "\\lambda x.x")

 procedure(define-preamble pa) → void? pa : string?
Adds a custom preamble. Use this to import any extra latex package. Custom .sty files are assumed to be relative to the current directory. Each call overwrites the previously defined preamble.

Example:

 (define-preamble (string-append "\\usepackage{mysty}\n" "\\usepackage{amsmath}\n" "\\usepackage{amsfonts}\n"))

Where mysty.sty is in the current directory.

 procedure(tex-remove-all-cached-files) → boolean?
Removes all cached files in <tmpdir>/slideshow-texfiles/ where <tmpdir> is equal to (find-system-path temp-dir).