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

1.1.5 2019-05-21 13:27 UTC

This package is auto-updated.

Last update: 2024-05-22 02:56:44 UTC


Latest Stable Version Total Downloads Build Status Code Coverage Scrutinizer Quality Score

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

Implementation based on cebe/markdown.


PHP 5.4 or higher is required to use it.

Installation is recommended to be done via composer by adding the following to the require section in your composer.json:

"cebe/markdown-latex": "*"

Run composer update afterwards.


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();

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

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

The command line script

You can use it to render this readme:

bin/markdown-latex > output.tex

Using github flavored markdown:

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

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

curl | 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

% url support

% make links clickable

% code listings

% include images

% better tables using tabularx

% support github markdown strikethrough




make a PDF with pdflatex main.tex.