Download the PHP package gregwar/tex2png-bundle without Composer

On this page you can find all versions of the php package gregwar/tex2png-bundle. 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 tex2png-bundle

Gregwar's Tex2pngBundle

GregwarTex2pngBundle provides a service and a twig helper to convert Tex formulas to PNG images

Installation

Step 1: Download the GregwarTex2pngBundle

Using the vendors script

Add the following lines to your deps file:

Now, run the vendors script to download the bundle:

Using submodules

If you prefer instead to use git submodules, then run the following:

Using Composer

Add the following to the "require" section of your composer.json file:

And update your dependencies

Step 2: Configure the Autoloader

If you use composer, you can skip this step.

Add it to your autoload.pp :

Step 3: Enable the bundle

Registers the bundle in your app/AppKernel.php:

Step 4: Configure the bundle and set up the directories

Adds the following configuration to your app/config/config.yml:

gregwar_tex2png: ~

If you want to customize the cache directory name, you can specify it:

gregwar_tex2png:
    cache_dir:  my_cache_dir

Creates the cache directory and change the permissions so the web server can write in it:

mkdir web/cache
chmod 777 web/cache

Usage

Basics

This bundle is based on the Gregwar's Tex2png class and provides a service and a twig extension :

<img src="{{ tex('\\sum_{i=0}^{i=n} i') }}" />

The PNG image will be generated using the formula and cached into a file. If this file already exists, it will do nothing else but just lookup for the good file name.

Note that you can use the tex_img twig function to generate the whole HTML tag :

{{ tex_img('\\sum_{i=0}^{i=n} i') }}

If you want to change the density (resolution) of the image, you can specify it as a second argument (defaults: 155) :

{{ tex_img('\\sum_{i=0}^{i=n} i', 300) }}

Using the service

Twig2pngBundle provides a servie that can be used to generate tex files directly from your own logics :

Requirements

GregwarTex2pngBundle need you to have latex and dvipng installed, a temporary directory, and the shell_exec() PHP function should be available and useable.

License

This bundle is under MIT license


All versions of tex2png-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 gregwar/tex2png-bundle contains the following files

Loading the files please wait ....