Skip to main content

Generate LaTeX for Github markdown files.

Project description

Generate LaTeX for Github markdown files.


This package assumes that latex and dvipng commands are already available in your system.

  • Mac users can install the dependencies with MacTeX.
  • Linux users can install with TexLive. One-line command to install on Ubuntu: sudo apt-get install texlive-full dvipng
  • Windows users please refer to this manual. Note that GiTeX has not been tested on Windows.


pip install gitex

The installation includes both gitex library and two command line executables. Note that GiTeX requires python3.


>> tex2png

Converts short tex code to png on command line.

usage: tex2png [-h] [-m MATH_MODE] [-d DPI] [-p PACKAGES] [-fg FOREGROUND]
               [-bg BACKGROUND] [-O]
               formula output_file

positional arguments:
  formula               LaTeX formula text
  output_file           output png file

optional arguments:
  -h, --help            show this help message and exit
  -m MATH_MODE, --math-mode MATH_MODE
                        LaTeX math mode: [inline, display, headless, none]
  -d DPI, --dpi DPI     Output resolution in DPI
  -p PACKAGES, --packages PACKAGES
                        `,` or `+` seperated list of LaTeX package names
                        additional to amsmath,amssymb, which are always
  -fg FOREGROUND, --foreground FOREGROUND
                        Set the foreground color (rgb or CSS3 color name, e.g.
  -bg BACKGROUND, --background BACKGROUND
                        Set the background color (rgb or CSS3 color name, e.g.
  -O, --optimize        Optimize output image using `optipng`

>> gitex

Compiles a GiTeX markdown into Github markdown with generated LaTeX images.

usage: GiTeX [-h] [-i IMAGE_FOLDER] [-r] [-d DPI] src_md output_md

positional arguments:
  src_md                Source markdown file
  output_md             Output markdown file

optional arguments:
  -h, --help            show this help message and exit
  -i IMAGE_FOLDER, --image-folder IMAGE_FOLDER
                        Folder for the generated latex images, must be
                        RELATIVE PATH with respect to your github dir.
  -r, --redraw          force all LaTeX formulas to redraw
  -d DPI, --dpi DPI     default global DPI for generated images

Python3 library

from gitex import tex2png # function API for `tex2png` command line script
from gitex import compile # function API for `gitex` command line script

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gitex, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size gitex-0.1-py3-none-any.whl (13.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gitex-0.1.tar.gz (9.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page