Skip to main content

Generate LaTeX for Github markdown files.

Project description

Generate LaTeX for Github markdown files.

Dependency

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.

Installation

pip install gitex

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

Usage

>> 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
                        included.
  -fg FOREGROUND, --foreground FOREGROUND
                        Set the foreground color (rgb or CSS3 color name, e.g.
                        `gold`)
  -bg BACKGROUND, --background BACKGROUND
                        Set the background color (rgb or CSS3 color name, e.g.
                        `deepskyblue`)
  -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

This version
History Node

0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
gitex-0.1-py3-none-any.whl (13.1 kB) Copy SHA256 hash SHA256 Wheel py3
gitex-0.1.tar.gz (9.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page