diff --git a/README.md b/README.md index a84fafa..44906aa 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ wraps latex rendering and generating with twig templates. This library does * using twig for latex templating * inserting user data into latex templates - * escaping user data, so no new latex commands can be introduced by userdata + * escaping user data, so no (new) latex commands can be introduced by userdata * renders latex file and returns pdf * has compact latex error logs # Installation diff --git a/composer.json b/composer.json index a664b10..c9ef032 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "description": "Renders LaTeX Templates in PHP", "type": "libary", "license": "MIT", + "version": "1.1.0", "authors": [ { "name": "Lukas Staab", diff --git a/src/LatexRenderer.php b/src/LatexRenderer.php index 7b26809..6744df7 100644 --- a/src/LatexRenderer.php +++ b/src/LatexRenderer.php @@ -31,10 +31,11 @@ class LatexRenderer * @param $templateDirs array|string the path(s) where the .tex.twig templates are found * @param $debug bool true the files will not be deleted after attempted rendering */ - public function __construct($templateDirs, string $latexExec = 'pdflatex', bool $debug = false) + public function __construct($templateDirs, string $tmpDir = '/tmp/', string $latexExec = 'pdflatex', bool $debug = false) { $this->debug = $debug; $this->latexExec = $latexExec; + $this->tmpDir = $tmpDir; $loader = new FilesystemLoader($templateDirs); $this->twig = new Environment($loader, [ 'debug' => $debug,