LatexCompiler
class LatexCompiler (View source)
Properties
| $fileName | |||
| $template | |||
| $pdfUrl | |||
| protected | $data | ||
| protected | $pdfName | ||
| protected | $runs | ||
| protected | $view | ||
| protected | $tempPath | ||
| protected | $buildDir | ||
| protected | $buildPath | ||
| protected | $pdfPath |
Methods
No description
Define the name of the file to be compiled without file suffix
Set data to be passed to the view
Override default runs
Define view
Delete PDF file
Set Storage Path
Compiles the PDF and store the path to the file
Fills in the template
Writes filled in template to file
Sends to terminal to compile in tex
Check for existing PDF and move from temp
Deletes build directory
Makes build directory
Details
at line 33
__construct()
at line 50
$this
compile(string $fileName)
Define the name of the file to be compiled without file suffix
at line 65
$this
with($data)
Set data to be passed to the view
at line 79
$this
runs(int $runs)
Override default runs
at line 93
$this
in(string $view)
Define view
at line 106
true
deletePdf()
Delete PDF file
at line 120
string
storagePath(string $storagePath)
Set Storage Path
at line 133
$this
run()
Compiles the PDF and store the path to the file
at line 152
string
fillTemplate()
Fills in the template
at line 163
protected
writeToFile()
Writes filled in template to file
at line 178
protected
compileTex()
Sends to terminal to compile in tex
Sets the absolute file position on the disk and attempts to run pdf latex after cding into the directory. If the exit code is anything other than 0, it logs the error in the latex.log, tears down the temp directory, and throws a new exception which can be caught if desired.
at line 202
protected
handlePDF()
Check for existing PDF and move from temp
Checks the PDF path to see if there is already a PDF with the same name. If there is, it deletes the PDF in the path and then moves the new PDF there. If not, then it moves the PDF.
at line 211
protected
tearDownTemp()
Deletes build directory
at line 219
protected
makeTempDir()
Makes build directory