Skip to content

Commit

Permalink
tmpdir to constructor
Browse files Browse the repository at this point in the history
version bump
  • Loading branch information
lukas-staab committed Nov 15, 2021
1 parent d84a852 commit 04b6440
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"description": "Renders LaTeX Templates in PHP",
"type": "libary",
"license": "MIT",
"version": "1.1.0",
"authors": [
{
"name": "Lukas Staab",
Expand Down
3 changes: 2 additions & 1 deletion src/LatexRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 04b6440

Please sign in to comment.