Skip to content

thethunderturner/filament-latex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filament LaTeX

Latest Version on Packagist GitHub Tests Action Status Fix PHP Code Styling Total Downloads

Compatibility

Peek Status Filament PHP
3.x Current version ^3.2.43 ^8.1
4.x To Be Added... ^4.0 ^8.1

🚀 Table of Contents

Demo

Filament LaTeX is a powerful package that allows you to generate PDFs from LaTeX templates. The plugin is still in development, but the basic functionality is implemented. filament-latex filament-latex-upload

Installation

Important

This branch is only compatible with Filament v3. If you are using Filament v4, please switch to branch 4.x.

Compiler Installation

Before you start, make sure you have texlive-full or texlive-base installed on your system. You can install it on an Unix based system (Linux/MacOS) by running:

sudo apt-get install texlive-full # for debian based systems
sudo pacman -S texlive-full # for arch based systems
brew install texlive-full # for MacOS

If you are on Windows then please visit the TeX Live website and follow the instructions.
After you have installed texlive, find where the pdflatex binary is located by running this in your console:

which pdflatex # for Unix based systems
where pdflatex # for Windows

Copy the path. You will later need to paste it in the plugin configuration file.

Package Installation

You can install the package via composer:

composer require thethunderturner/filament-latex

With the install command, the package will automatically publish the migrations and the config file.

php artisan filament-latex:install

Optionally, you can publish them individually:

php artisan vendor:publish --tag="filament-latex-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="filament-latex-config"

After publishing the path, make sure you replace the path of your pdflatex binary in the config/filament-latex.php file.

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-latex-views"

Package Usage

You can use the package by adding it to the plugins list of your panel.

->plugins([
    // ...
    FilamentLatexPlugin::make(),
]);

You also need a custom theme in order to compile some of the tailwind classes. You need to add the path of the blade views in the content array of tailwind.config.js of your theme like so:

export default {
    presets: [preset],
    content: [
        // ...
        './vendor/thethunderturner/filament-latex/{resources,src}/{views,}/**/*.{blade.php,php}',
    ],
}

Documentation

You can override the default resource, by specifying the new resource in the callback of the plugin:

FilamentLatexPlugin::make()
    ->resource('path/to/your/resource')

Your new resource should extend the default FilamentLatexResource class.

Now we just need to compile the tailwind classes

npm install
npm run build

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.

License

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

About

LaTeX editor built for filamentphp

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published