Download the PHP package agungsugiarto/latex-for-laravel without Composer

On this page you can find all versions of the php package agungsugiarto/latex-for-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package latex-for-laravel

LaTeX for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package that provides seamless integration between Laravel Blade templates and LaTeX, enabling you to create dynamic PDF documents using familiar Blade syntax while maintaining valid LaTeX structure.

Features

Support us

Support via Saweria

If this package helps you in your projects, consider supporting the development by buying me a coffee on Saweria.

Your support helps maintain and improve this package for the Laravel community. โ˜•๏ธ

Installation

You can install the package via composer:

The package will automatically register its service provider.

Requirements

Quick Start

Create a LaTeX template file resources/views/invoice.blade.tex:

Use it in your controller:

LaTeX Template Structure

All .blade.tex files must follow this structure to ensure they are valid LaTeX documents that can be compiled directly while still supporting Laravel Blade directives.

Required Structure

1. Include the \newcommand{\blade}[1]{} definition

Every LaTeX template must include this command in the preamble:

2. Wrap all Blade directives in \blade{}

All PHP/Blade code must be wrapped in \blade{} commands. There are three forms of blade directives:

Escaped Output: \blade{{ expression }}

For safe output of variables that should be escaped to prevent LaTeX compilation issues:

Unescaped Output: \blade{!! expression !!}

For raw LaTeX content that should be rendered without escaping:

Literal Content: \blade{content}

For Blade directives, PHP code, and other content that should pass through directly:

Complete Example

Benefits of This Structure

  1. Valid LaTeX: The file can be compiled directly with pdflatex without processing Blade directives
  2. Blade Processing: Laravel can process all \blade{} commands to generate dynamic content
  3. IDE Support: LaTeX editors will recognize the file as valid LaTeX and provide syntax highlighting
  4. Version Control: The files are readable and diffable in version control systems

Pipeline Processing Architecture

The package uses a modern pipeline-based approach for processing LaTeX templates, providing clean separation of concerns and extensibility for custom use cases.

How It Works

The compilation process follows these steps:

  1. Blade Directive Processing: Using Laravel Pipeline, the compiler processes different types of \blade{} directives:

    • \blade{!! raw content !!} โ†’ Direct unescaped output
    • \blade{{ expression }} โ†’ Escaped output (converted to markers, then restored as PHP echo statements)
    • \blade{literal content} โ†’ Direct literal content (for Blade directives, PHP code, etc.)
  2. Blade Compilation: Standard Laravel Blade compilation processes the resulting template

  3. Marker Restoration: Another pipeline restores any temporary markers to proper PHP code

Built-in Processors

Raw Content Processor

Handles unescaped LaTeX content:

Echo Expression Processor

Handles escaped variable output:

Literal Content Processor

Handles Blade directives and PHP code:

Extending the Pipeline

You can add custom processors and restorers to handle specialized LaTeX needs:

Adding Custom Processors

Adding Custom Restorers

Complete Custom Extension Example

Register the service provider in your config/app.php:

Usage in Templates

After registering the extension:

API Reference

Compilation Methods

The compile() method supports various output destinations:

Advanced Usage

Using with Blade Components

Create reusable LaTeX components:

Use in your main template:

Working with Complex LaTeX Structures

For advanced LaTeX documents with multiple processors:

Example Template for Advanced Processors

Error Handling

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of latex-for-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0||^11.0||^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package agungsugiarto/latex-for-laravel contains the following files

Loading the files please wait ....