diff options
author | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2011-09-01 10:21:02 +0200 |
---|---|---|
committer | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2011-09-01 10:21:02 +0200 |
commit | af7a485837571257c667fcdee37a5ec54d141b22 (patch) | |
tree | a538b7b486e93e3c8dd6b6de9cd4c595a7f4817b /mod | |
parent | 74eba2da623026635b3281e61c3d5e33e3f473a0 (diff) | |
download | context-rst-af7a485837571257c667fcdee37a5ec54d141b22.tar.gz |
preliminary math directive
Diffstat (limited to 'mod')
-rw-r--r-- | mod/tex/context/third/rst/rst_directives.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mod/tex/context/third/rst/rst_directives.lua b/mod/tex/context/third/rst/rst_directives.lua index 3bc4166..96eaf59 100644 --- a/mod/tex/context/third/rst/rst_directives.lua +++ b/mod/tex/context/third/rst/rst_directives.lua @@ -253,6 +253,34 @@ rst_directives.lua = function(name, data) return luacode end +-------------------------------------------------------------------------------- +--- Experimental math directive +-------------------------------------------------------------------------------- + +rst_directives.math = function (name, data) + data = data or name + local formula + if type(data) == "table" then + local last, i = table.maxn(data), 1 + while i <= last do + local line = stringstrip(data[i]) + if line and line ~= "" then + formula = formula and formula .. " " .. line or line + end + i = i + 1 + end + end + return fmt([[ +\startformula +%s +\stopformula +]], formula) +end + +-------------------------------------------------------------------------------- +--- End math directive +-------------------------------------------------------------------------------- + rst_directives.replace = function(name, data) return fmt([[ |