Giter Club home page Giter Club logo

t2t_math_ml's Introduction

Math Formulas in txt2tags with t2t_math_ml

Presentation

t2t_math_ml is a PERL script to be used together with txt2tags in order to translate formulas to MathML in the generated web pages.

It takes the xhtml file generated by txt2tags where the formulas are still in LaTeX format, filter them out to translate them using latexmlmath and put them back in the result file.

LaTeXML is used to generate the NIST Digital Library of Mathematical Functions, so it should be powerful enough for small formulas ;-)

Requirements

Tested with:

  • txt2tags version 2.6
  • perl v5.14.2
  • latexmlmath included in LaTeXML version 0.7.0 (at least on Ubuntu, it can be obtained with: sudo apt-get install latexml)

But it might work with other versions.

Get It

Download

You can get if from GitHub, or download the last pre-packed version:

Installation

$ tar -zxvf t2t_math_ml-0.1.tgz

and the script, called t2t_math_ml, is in there.

The Makefile is only needed to compile the test, or to generation the documentation (this file) to other formats ( md or html).

Quick Start

Input file

In the txt2tags input file, the LaTeX formulas can be inline:

like this: ''$x = \sqrt{y+z}$''

Or in a one line block:

''' $$ x = \sqrt{a + b + c} $$

Or in a math block on one or several lines:

'''
$$
|x| = \left\{ \begin{array}{rl}
 -x & \mbox{ if } x<0 \\
  x & \mbox{ otherwise}
       \end{array} \right.
$$
'''

See some examples here ( source, xhtml, pdf ).

Some examples of LaTeX formulas can be found in LaTeX Cookbook.

You might need to add :

    %!postproc(xhtml): "<head>" '<head><meta http-equiv="Content-type" content="application/xhtml+xml;charset=UTF-8"/>'

in your t2t source file to be able to seen the MathML formulas (see in the test file).

Compilation

    $ txt2tags -t xhtml -o test.xhtml0 test.t2t
    $ ./t2t_math_ml test.xhtml0

creates test.xhtml.

Project Management

Issues

The current version is a first try, but should work in simple cases. See GitHub issues for known problems, and please report there for any remark (bug, feature wish, etc).

Changelog

  • [2015-10-28] t2t_math_ml-02: put it on GitHub: change the doc and the Makefile, add a LICENSE.
  • [2013-09-03] t2t_math_ml-01: first distributed version.

t2t_math_ml's People

Contributors

a-mani avatar karmaki 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.