hollingberry / texmath-ruby

Convert math markup between LaTeX, MathML, and OMML using Ruby.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

texmath-ruby

Build Status Gem Version Gem Downloads

A Ruby wrapper for TeXMath, the Haskell library for converting between LaTeX, presentation MathML, and OMML (Office Math Markup Language).

Example

require 'texmath'

TeXMath.convert('a^2 + b^2 = c^2', :from => :tex, :to => :mathml)
  # => '<math display="block" xmlns=...'

See the source for a list of the supported math markup formats.

Installation

Installing the Haskell library

On OS X, you can install texmath with Homebrew:

$ brew update
$ brew install texmath

On Linux, you'll need to install the The Haskell Platform and install texmath with Cabal:

$ cabal update
$ cabal install texmath -fexecutable

Finally, don't forget to add $HOME/.cabal/bin to your $PATH.

Installing the Ruby wrapper

If you use Bundler, add this line to your application's Gemfile:

gem 'texmath-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install texmath-ruby

About

Convert math markup between LaTeX, MathML, and OMML using Ruby.

License:MIT License


Languages

Language:Ruby 100.0%