PHPackages                             corny-phoenix/tex-tools - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. corny-phoenix/tex-tools

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

corny-phoenix/tex-tools
=======================

PHP library for (La)TeX abstraction

0.3(9y ago)511.9kMITPHPPHP &gt;=5.5

Since Jan 10Pushed 9y ago2 watchersCompare

[ Source](https://github.com/CornyPhoenix/tex-tools)[ Packagist](https://packagist.org/packages/corny-phoenix/tex-tools)[ Docs](https://github.com/CornyPhoenix/tex-tools)[ RSS](/packages/corny-phoenix-tex-tools/feed)WikiDiscussions develop Synced 1w ago

READMEChangelog (2)Dependencies (3)Versions (5)Used By (0)

TeX Tools for PHP 0.3
=====================

[](#tex-tools-for-php-03)

[![Build Status](https://camo.githubusercontent.com/e1c5bbb47e14bf1072ccca876132a1f9feb2d084d68b66004be2d3d10e702231/68747470733a2f2f7472617669732d63692e6f72672f436f726e7950686f656e69782f7465782d746f6f6c732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/CornyPhoenix/tex-tools) [![Code Climate](https://camo.githubusercontent.com/e3ec348095709a2fa451bcfb632ca454b366caebd66823576f727a48c828d3ee/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f436f726e7950686f656e69782f7465782d746f6f6c732f6261646765732f6770612e737667)](https://codeclimate.com/github/CornyPhoenix/tex-tools) [![Test Coverage](https://camo.githubusercontent.com/3d8fffe78642e5a8ed52c9557bd236aedbdee381ab9e31259552cf693e02c193/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f436f726e7950686f656e69782f7465782d746f6f6c732f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/CornyPhoenix/tex-tools)

> PHP library for (La)TeX abstraction

- [Installation](#installation)
- [Supported TeX Commands](#supported-tex-commands)
- [Usage](#usage)

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

[](#installation)

Add following to your `composer.json`:

```
"require": {
    "corny-phoenix/tex-tools": "dev-master"
}
```

Supported TeX Commands
----------------------

[](#supported-tex-commands)

The following TeX commands are supported:

CommandRequired formatProvided formatsTeX`.tex``.dvi`, `.log`, `.aux`PdfTeX`.tex``.pdf`, `.log`, `.aux`LaTeX`.tex``.dvi`, `.log`, `.aux`PdfLaTeX`.tex``.pdf`, `.log`, `.aux`XeLaTeX`.tex``.pdf`, `.log`, `.aux`LuaLaTeX`.tex``.pdf`, `.log`, `.aux`BibTeX`.aux``.bbl`, `.blg`BibTeX8`.aux``.bbl`, `.blg`MakeIndex`.idx``.ind`, `.ilg`DviPs`.dvi``.ps`Usage
-----

[](#usage)

Create a basic PdfLaTeX job and run it:

```
use CornyPhoenix\Tex\Repositories\TemporaryRepository;

$job = (new TemporaryRepository())->createJob( /* TeX source */ );
$job->runPdfLaTex();
$job->hasErrors(); // False if everything went fine
```

You can also chain LaTeX calls:

```
use CornyPhoenix\Tex\Repositories\TemporaryRepository;
use CornyPhoenix\Tex\Exceptions\CompilationException;

$job = (new TemporaryRepository())->createJob( /* TeX source */ );
$job->runPdfLaTex()
    ->runBibTex()
    ->runMakeIndex()
    ->runPdfLaTex()
    ->runPdfLaTex();
```

There is a lovely interface for handling errors:

```
use CornyPhoenix\Tex\Repositories\TemporaryRepository;
use CornyPhoenix\Tex\Exceptions\CompilationException;

$job = (new TemporaryRepository())->createJob( /* TeX source */ );
try {
    $job->runPdfLaTex()
        ->runBibTex()
        ->runMakeIndex()
        ->runPdfLaTex()
        ->runPdfLaTex();
} catch (CompilationException $e) {
    $format = 'Error in %s, line %d: %s';
    $log = $job->createLog();

    foreach ($log->getErrors() as $error) {
        echo sprintf(
            $format,
            $error->getFilename(),
            $error->getLine(),
            $error->getMessage()
        );
        // handle error ...
    }
}
```

Also, there is a safe `clean` method which will clean up your working directory without deleting the input file or any files unknown to TeX:

```
use CornyPhoenix\Tex\Repositories\TemporaryRepository;

$repo = new TemporaryRepository();
touch($repo->getDirectory() . '/file.unknown.to.tex');
$repo->clean();
assert(file_exists($repo->getDirectory() . '/file.unknown.to.tex')); // True
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.6% 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 ~88 days

Total

3

Last Release

3605d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/392181bc18c156d57cd2ecf8d616cf70ced7cf3393af228f4ca00778464d0069?d=identicon)[CornyPhoenix](/maintainers/CornyPhoenix)

---

Top Contributors

[![ksm2](https://avatars.githubusercontent.com/u/1469675?v=4)](https://github.com/ksm2 "ksm2 (31 commits)")[![digilist](https://avatars.githubusercontent.com/u/833667?v=4)](https://github.com/digilist "digilist (7 commits)")

---

Tags

pdflatexbibtextexxelatexlualatexpost script

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/corny-phoenix-tex-tools/health.svg)

```
[![Health](https://phpackages.com/badges/corny-phoenix-tex-tools/health.svg)](https://phpackages.com/packages/corny-phoenix-tex-tools)
```

###  Alternatives

[knplabs/knp-snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.

4.5k68.3M56](/packages/knplabs-knp-snappy)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[chrome-php/chrome

Instrument headless chrome/chromium instances from PHP

2.6k4.5M64](/packages/chrome-php-chrome)[pontedilana/php-weasyprint

PHP library allowing PDF generation from an url or a html page. Wrapper for Kozea/WeasyPrint.

761.1M7](/packages/pontedilana-php-weasyprint)[mostafaznv/pdf-optimizer

PDF optimization tool for PHP and Laravel applications

170125.8k](/packages/mostafaznv-pdf-optimizer)[mnvx/lowrapper

PHP wrapper over LibreOffice converter

129190.5k](/packages/mnvx-lowrapper)

PHPackages © 2026

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