Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


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.