PHPackages                             pavel852/latex - 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. pavel852/latex

ActiveLibrary

pavel852/latex
==============

A LaTeX integration library for PHP.

3.3(1y ago)0141MITPHPPHP &gt;=7.0

Since Oct 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Pavel852/latex)[ Packagist](https://packagist.org/packages/pavel852/latex)[ Docs](https://github.com/Pavel852/latex)[ RSS](/packages/pavel852-latex/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (1)

LaTeX PHP Parser
================

[](#latex-php-parser)

Tato PHP knihovna poskytuje funkce pro převod LaTeXových výrazů do HTML za použití různých možností formátování. Funkce jsou navrženy tak, aby umožňovaly snadný převod a zobrazení LaTeXových vzorců přímo ve vašem HTML výstupu.

Funkce
------

[](#funkce)

### 1. `latex_settings($options)`

[](#1-latex_settingsoptions)

Nastaví globální formátování parseru.

- **Parametry:**
    - `$options` (řetězec): Oddělený seznam voleb jako `'cz,html'` nebo `'us,char'`.
- **Příklady použití:**```
    latex_settings('cz,html'); // Nastaví české formátování a HTML entity
    latex_settings('us,char'); // Nastaví anglické formátování a UTF-8 znaky
    ```

### 2. `latex_formula($input)`

[](#2-latex_formulainput)

Převede daný LaTeXový výraz na HTML výstup.

- **Parametry:**
    - `$input` (řetězec): LaTeXový výraz.
- **Příklady použití:**```
    echo latex_formula('E = mc^2');
    echo latex_formula('S = \sum_{n=1}^\infty \frac{1}{n^2}');
    ```

### 3. `latex_replace($text, $start='/*', $end='*/')`

[](#3-latex_replacetext-start-end)

Nahrazuje v zadaném textu LaTeXové výrazy jejich HTML ekvivalenty, včetně formátování, odstraní oddělovače.

- **Parametry:**
    - `$text` (řetězec): Text obsahující LaTeX výrazy.
    - `$start` (řetězec): Počáteční oddělovač (výchozí `'/*'`).
    - `$end` (řetězec): Koncový oddělovač (výchozí `'*/'`).
- **Příklady použití:**```
    $text = 'Vzorec: /*E = mc^2*/.';
    echo latex_replace($text);
    ```

### 4. `latex_version()`

[](#4-latex_version)

Vrací aktuální verzi knihovny.

- **Příklad použití:**```
    echo latex_version();
    ```

Praktické příklady
------------------

[](#praktické-příklady)

Příklady použití naleznete v souborech `latex_test1.php`, `latex_test2.php` a `latex_test3.php`.

Licence
-------

[](#licence)

Tento projekt je licencován pod licencí MIT. Více informací naleznete v souboru `LICENSE`.

Composer Setup
--------------

[](#composer-setup)

1. **Updating Dependencies**: Run `composer update` to update all dependencies as per the project's `composer.json` file.
2. **Installing the New Package**: Run `composer require pavel852/latex` to install the `pavel852/latex` package. This package allows for handling HTML templates with ease.

Usage Instructions
------------------

[](#usage-instructions)

To utilize the package in your project, follow these steps:

- Add all dependencies by including `require 'vendor/autoload.php';` at the beginning of your PHP file.
- Import the package with `use pavel852/latex;` to access its functionalities.
- You can open a template using `print latex_formula('E = mc^2');`.
-

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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 ~0 days

Total

4

Last Release

559d ago

Major Versions

2.1.0 → 3.02024-10-28

### Community

Maintainers

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

---

Top Contributors

[![Pavel852](https://avatars.githubusercontent.com/u/64414182?v=4)](https://github.com/Pavel852 "Pavel852 (40 commits)")

---

Tags

phputf-8latex

### Embed Badge

![Health badge](/badges/pavel852-latex/health.svg)

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

###  Alternatives

[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M491](/packages/mpdf-mpdf)[kartik-v/mpdf

A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support. This is a fork of the official mPDF library.

39328.4k1](/packages/kartik-v-mpdf)

PHPackages © 2026

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