GithubHelp home page GithubHelp logo

gitex's Introduction

GiTeX

Generate LaTeX for Github markdown files.

Python version Github release PyPI version PyPI status

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 the gitex python3 library and two command line executables.

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

gitex's People

Contributors

linxifan avatar

Watchers

 avatar  avatar  avatar

Forkers

xinyicao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.