Code Monkey home page Code Monkey logo

latex's Introduction

latex

go.dev reference GitHub release CI codecov GoDoc License

latex is a package holding Go tools for LaTeX.

latex is supposed to provide features akin to MathJax or matplotlib's TeX capabilities. ie: it is supposed to be able to draw mathematical equations, in pure-Go.

latex is NOT SUPPOSED to be a complete typesetting system like LaTeX or TeX.

For this, please take look at:

Eventually, go-latex/latex might just use star-tex.org/... to provide the MathJax-like capabilities. (once star-tex.org/... is ready and exports a nice Go API.)

Installation

$> go get github.com/go-latex/latex/...

Documentation

Documentation is served by godoc, here:

The main use case for go-latex/latex is to draw a mathematical equation. This is typically achieved via the latex/mtex.Render function that knows how to render mathematical TeX equations to a renderer interface.

Example

package main

import (
	"os"

	"github.com/go-latex/latex/drawtex/drawimg"
	"github.com/go-latex/latex/mtex"
)

func main() {
	f, err := os.Create("output.png")
	if err != nil {
		panic(err)
	}
	defer f.Close()

	dst := drawimg.NewRenderer(f)
	err = mtex.Render(dst, `$f(x) = \frac{\sqrt{x +20}}{2\pi} +\hbar \sum y\partial y$`, 12, 72, nil)
	if err != nil {
		panic(err)
	}

	err = f.Close()
	if err != nil {
		panic(err)
	}
}

LICENSE

BSD-3.

latex's People

Contributors

sbinet avatar

Watchers

 avatar  avatar

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.