PHPackages                             fvhockney/latexcompiler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fvhockney/latexcompiler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fvhockney/latexcompiler
=======================

A LaTeX compiler for user provided data in Laravel

v0.2.0(8y ago)33.3kMITHTML

Since Jun 5Pushed 8y agoCompare

[ Source](https://github.com/fvhockney/latexcompiler)[ Packagist](https://packagist.org/packages/fvhockney/latexcompiler)[ Docs](https://github.com/fvhockney/latexcompiler)[ RSS](/packages/fvhockney-latexcompiler/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (4)Used By (0)

latexcompiler
=============

[](#latexcompiler)

This project aims to create an intuitive way for laravel users to create PDF documents through LaTeX with minimal pain.

I leverage the `blade` template to write the actual LaTeX code and compile with `pdflatex`. This allows for the use of `{{ }}` to drop in variables and use all of the normal `blade` commands.

Installation
------------

[](#installation)

Available through composer:

`composer require fvhockney/latexcompiler`

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=fvlatex-config
```

This publishes the default configuration file to `config/fvlatex.php` where you can modify your default preferences.

**NB:** logging automatically merges from the vendor file `fvlatexlogchannel.php` to the default `config/logging.php` file on `boot`.

Usage
-----

[](#usage)

This packages is compatible with injection. You can use the fluent interface to pass in required and optional parameters.

### Required

[](#required)

- `->with($data)`: (object|array) passes to the template to fill
- `->in($view)` : (string) name of the view you wish to use to create the `.tex` document
- `->complie($name)` : (string) the name of the file you want to use without any extensions

### Optional

[](#optional)

- `->runs($runs)` : (integer) number of times you want `pdflatex` to run, defaults to config which is initially set at 2
- `->storagePath($path)` : (string path) overrides the default storage path in config...useful for multi user systems
- `->deletePdf()` : ***beta*** deletes the pdf from the storage path

### Create Something

[](#create-something)

- `->run()` : compiles the document in a build directory and moves it to the storage path. It then tears down the build directory
- `->fillTemplate()` : fills in the tempplate but doesn't run the shell commands to compile the PDF.

#### Getting results

[](#getting-results)

- `->pdfUrl` : called after `->run()` to get the storage location with the filename of the PDF.
- `->template` : called after `->run()` or `->fillTemplate` to get the `tex` string

Try out
-------

[](#try-out)

There is an example controller, tex template view, and form view included for you to try this out in your setup without having to waste time writing the form and tex files. Just copy the controller to your `app/Http/Controllers`, set up at `GET` route for the form and `POST` to the controller to get started.

IMPORTANT!!
-----------

[](#important)

Make sure you have tex installed on your system and that you provide the fully qualified path to where `pdflatex` is located.

LaTeX can be pretty finicky, so I highly recommend that you test your templates extensively on a local system before deploying. Also, there is currently no escaping of user inputs, so if your users input a reserved character in Tex, it will not be escaped automatically and could break the compilation sequence.

TODO
----

[](#todo)

- Add to &lt;pakagist.org&gt;
- Add ability to escape user inputs
- Add ability to compile assets
- Find a better way to implement logging
- Give user more control over logging
- Add options to upload to cloud

Collaboration
-------------

[](#collaboration)

I would love to hear your thoughts and ideas about how to make this package better! Feel free to contact me, fork, or submit a pull request!

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Total

2

Last Release

2930d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de60fbd5ad108d0c1f9e39e467a41b94024bebd5b53e134c5e76a9ece57788b5?d=identicon)[fvhockney](/maintainers/fvhockney)

---

Top Contributors

[![fvhockney](https://avatars.githubusercontent.com/u/30329026?v=4)](https://github.com/fvhockney "fvhockney (20 commits)")

---

Tags

laravellatexlatex-compilerphplaravellatexlatex compiler

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fvhockney-latexcompiler/health.svg)

```
[![Health](https://phpackages.com/badges/fvhockney-latexcompiler/health.svg)](https://phpackages.com/packages/fvhockney-latexcompiler)
```

###  Alternatives

[stephenjude/filament-blog

Filament Blog Builder

20619.4k](/packages/stephenjude-filament-blog)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11273.0k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
