PHPackages                             cebe/markdown-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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. cebe/markdown-latex

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

cebe/markdown-latex
===================

A super fast, highly extensible markdown parser for PHP, that converts markdown files into latex

1.1.5(7y ago)51766.1k↓20.2%5[1 PRs](https://github.com/cebe/markdown-latex/pulls)7MITPHPPHP &gt;=5.4.0

Since Oct 21Pushed 4y ago2 watchersCompare

[ Source](https://github.com/cebe/markdown-latex)[ Packagist](https://packagist.org/packages/cebe/markdown-latex)[ Docs](https://github.com/cebe/markdown-latex#readme)[ RSS](/packages/cebe-markdown-latex/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (7)

markdown-latex
==============

[](#markdown-latex)

[![Latest Stable Version](https://camo.githubusercontent.com/ffbc05ddcc6a42eb4e01581a005fb1a8da2df11516d05e65aca93cf5f0e5b9fd/68747470733a2f2f706f7365722e707567782e6f72672f636562652f6d61726b646f776e2d6c617465782f762f737461626c652e706e67)](https://packagist.org/packages/cebe/markdown-latex)[![Total Downloads](https://camo.githubusercontent.com/f00d9e8374ef5434cc6d264a61e7bfb4033ff35f2250216a4cb87dd209776b38/68747470733a2f2f706f7365722e707567782e6f72672f636562652f6d61726b646f776e2d6c617465782f646f776e6c6f6164732e706e67)](https://packagist.org/packages/cebe/markdown-latex)[![Build Status](https://camo.githubusercontent.com/7f23cf2525ebd97dc8bbfd28a68c1b5b4b3b38af92ef221d73eb363aa80a7118/68747470733a2f2f7472617669732d63692e6f72672f636562652f6d61726b646f776e2d6c617465782e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cebe/markdown-latex)[![Code Coverage](https://camo.githubusercontent.com/b26e72c7c149f94cb10ccb3f2cff977511b56e36618aeb55cfd305b9f1de1765/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636562652f6d61726b646f776e2d6c617465782f6261646765732f636f7665726167652e706e673f733d64623661663334326435356265613634393330376566333131666264353336616262396261623736)](https://scrutinizer-ci.com/g/cebe/markdown-latex/)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/331b6709c387784d5d89d122c451274c0c3c98e4dae14ea71a986542fe04c2c5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636562652f6d61726b646f776e2d6c617465782f6261646765732f7175616c6974792d73636f72652e706e673f733d31373434386361346431343034323966643638376335386666373437626165623635363864353238)](https://scrutinizer-ci.com/g/cebe/markdown-latex/)

A markdown parser for converting markdown to LaTeX written in PHP.

Implementation based on [cebe/markdown](https://github.com/cebe/markdown "A markdown parser for PHP").

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

[](#installation)

PHP 5.4 or higher is required to use it.

Installation is recommended to be done via [composer](https://getcomposer.org/ "The PHP package manager") by adding the following to the `require` section in your `composer.json`:

```
"cebe/markdown-latex": "*"
```

Run `composer update` afterwards.

Usage
-----

[](#usage)

### In your PHP project

[](#in-your-php-project)

To use the parser as is, you just create an instance of a provided flavor class and call the `parse()`- or `parseParagraph()`-method:

```
// default markdown and parse full text
$parser = new \cebe\markdown\latex\Markdown();
$parser->parse($markdown);

// use github
$parser = new \cebe\markdown\latex\GithubMarkdown();
$parser->parse($markdown);

// parse only inline elements (useful for one-line descriptions)
$parser = new \cebe\markdown\latex\GithubMarkdown();
$parser->parseParagraph($markdown);
```

### The command line script

[](#the-command-line-script)

You can use it to render this readme:

```
bin/markdown-latex README.md > output.tex

```

Using github flavored markdown:

```
bin/markdown-latex --flavor=gfm README.md > output.tex

```

or convert the original markdown description to html using the unix pipe:

```
curl http://daringfireball.net/projects/markdown/syntax.text | bin/markdown-latex > output.tex

```

To create a latex document you have to include the generated latex source in a latex document `main.tex`:

```
\documentclass[a4paper, 12pt]{article}

% english and utf8
\usepackage[british]{babel}
\usepackage[utf8]{inputenc}

% url support
\usepackage{url}

% make links clickable
\usepackage{hyperref}

% code listings
\usepackage{listings}

% include images
\usepackage{graphicx}

% better tables using tabularx
\usepackage{tabularx}

% support github markdown strikethrough
% http://tex.stackexchange.com/questions/23711/strikethrough-text
\usepackage{ulem}

\begin{document}

	\include{output.tex}

\end{document}
```

make a PDF with `pdflatex main.tex`.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~250 days

Total

7

Last Release

2555d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/261a6249c6f605f3956a2fae40fbb813f6b2e1e6f2bf806180c851a965426e54?d=identicon)[cebe](/maintainers/cebe)

---

Top Contributors

[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (38 commits)")

---

Tags

hacktoberfestlatexmarkdownmarkdown-parsermarkdown-to-pdfphpmarkdowngfmextensiblefastmarkdown-extralatex

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cebe/markdown

A super fast, highly extensible markdown parser for PHP

1.0k32.5M136](/packages/cebe-markdown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

3.0k404.0M702](/packages/league-commonmark)[erusev/parsedown-extra

An extension of Parsedown that adds support for Markdown Extra.

84314.8M192](/packages/erusev-parsedown-extra)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)[alfredo-ramos/parsedown-extra-laravel

A Parsedown Extra package for Laravel

30155.1k1](/packages/alfredo-ramos-parsedown-extra-laravel)[tovic/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5933.7k](/packages/tovic-parsedown-extra-plugin)

PHPackages © 2026

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