ULMUL (Ultra Lightweight MarkUp Language)

"ULMUL" is an original Ultra Lightweight MarkUp Language. Using "ulmul2html5" or "ulmul2mathjax" commands, You can convert a ULMUL text with TeX style equations into HTML5 documents with MathML or MathJax, respectively. ULMUL is written in Ruby. You can also use ulmul.rb as a library.

Homepage of ULMUL: http://t-nissie.users.sourceforge.net/ULMUL/

Ruby Gem of ULMUL: http://rubygems.org/gems/ulmul

Repository of ULMUL: https://github.com/t-nissie/ULMUL

Table of Contents:


Installation of ULMUL

Please use gem ( RubyGems https://rubygems.org/ ) for the installation.

 $ sudo gem install ulmul

If you do not have the eim_xml, math_ml, aasm and exifr libraries, gem will download and install the libraries automatically.

How to write ULMUL texts

The encode of input file must be utf-8.


Inside ulmul.rb, input lines are processed as "events" with aasm library https://rubygems.org/gems/aasm .


Empty lines divide paragraphs.


Starting with "= ", "== ", "=== ", "==== ", "===== ", and "====== ". "= " will be used for the title.


Lines starting with asterisks become itemizing list. For example,

# Nesting is allowed up to 4th--5th level.
 * First
   * Second
     * Third
       * Fourth
       * more for Fourth
     second continue
     * More for third
 * More for first



Lines starting with some spaces but not asterisks become verbatim lines.


EOF or "=end" end the process.


Lines starting with "#" and "=begin" are ignored.


Other lines.

Other rules



Mass $m$ can be converted into energy $E$ as


Mass m can be converted into energy E as E=mc2.

You can refer the equation in a way like "Eq:Einstein", as Eq. (1).

To view the equations in MathML correctly, please use


Start a Figure environment with "\Fig:foo FILENAME.jpg" and terminate it with "/Fig:foo", where "foo" is a tag for the figure. You can write a figure caption between them. You can refer the figure with "Fig:foo" as Fig. 1.


\Fig:ruby ruby.jpg
  The is a dummy figure for an example.
  Cute red logo of Ruby, isn't it?
  You can write equations even in a caption as $ax^2+bx+c=0$.


Figure 1: The is a dummy figure for an example. Cute red logo of Ruby, isn't it? You can write equations even in a caption as ax2+bx+c=0.


Table environment is NOT IMPLEMENTED yet. Start a Table environment with "\Table:bar" and terminate it with "/Table:bar", where "bar" is a tag for the table. You can write a table caption between them. You can refer the table with "Table:bar" as Table 1.


  The is a dummy caption for the table.


Table 1: The is a dummy caption for the table.
Not yet implemented


Start a Code environment with "\Code:baz FILENAME" and terminate it with "/Code:baz", where "baz" is a tag for the code. You can write a caption between them. You can refer the code with "Code:baz" as Code 1. Code will be highlighted with google-code-prettify when -j https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js is given.


\Code:hello hello.c
  Ordinary hello.c.
  Can you see stdio.h?


Code 1: Ordinary hello.c. Can you see stdio.h? (download: hello.c)

/* hello.c */
#include <stdio.h>
int main()
  printf("hello, world\n");
  return 0;

Usage of ulmul2html5


$ ulmul2html5 foo.txt > foo.html
$ ulmul2html5 -n 'Takeshi Nishimatsu' -s ulmul-slidy.css -j ulmul-slidy.js presentation.txt > presentation.html

Command options


Show a help message.

-s, --style

Specify stylesheet filename.

-n, --name

Specify your name for copyright notices.

-j, --javascript

Specify JavaScript filename.

-l, --language

Specify natural language. Its default is "en".

-m, --max-table-of-contents

Maximum depth for the Table of Contents. Its default is 3. If you do not need the Table of Contents, specify 1.

ULMUL and Slidy examples

ulmul2xhtml is obsolete

ulmul2xhtml will be removed from next version 0.6.x.

Usage of ulmul2mathjax

It uses MathJax http://www.mathjax.org/ to show equations.

$ ulmul2mathjax --help
$ ulmul2mathjax -s ulmul2html5.css -j https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js \
  -j 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default' README-en > README-en-mathjax.html

Usage of ulmul2latex

$ ulmul2latex --help
$ ulmul2latex test.ulmul | tee test.tex
$ latex test.tex
$ latex test.tex
$ dvipdfmx test.dvi

ulmul2latex is still under development. Sorry.


For more, see TODO file.

Repository in GitHub

You can clone the source tree of ULMUL from GitHub with git(1) command:

$ git clone git@github.com:t-nissie/ULMUL.git ulmul


Copyright © 2008,2009,2010,2011,2012,2013,2014,2015,2017 by Takeshi Nishimatsu

ulmul.rb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. You can copy, modify and redistribute ulmul.rb, but only under the conditions described in the GNU General Public License (the "GPL").

W3C has copyrights for ulmul-slidy.js and ulmul-slidy.css. Their original names were slidy.js and slidy.css, respectively. Takeshi Nishimatsu slightly modified them. You can download the original package, slidy.zip, from http://www.w3.org/Talks/Tools/Slidy/ . You can find their licenses at http://www.w3.org/Consortium/Legal/copyright-documents and http://www.w3.org/Consortium/Legal/copyright-software .

Author of ULMUL

Takeshi Nishimatsu (t_nissie{at}yahoo.co.jp) http://t-nissie.users.sourceforge.net/

Copyright © 2017 Takeshi Nishimatsu