From 97808eec2f8c35daacdd398fae71458fd22846dd Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 1 Sep 2011 09:48:36 +0200 Subject: preliminary math role && escaping exception --- mod/tex/context/third/rst/rst_context.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'mod/tex/context') diff --git a/mod/tex/context/third/rst/rst_context.lua b/mod/tex/context/third/rst/rst_context.lua index 1ce25f0..adc2c64 100644 --- a/mod/tex/context/third/rst/rst_context.lua +++ b/mod/tex/context/third/rst/rst_context.lua @@ -169,7 +169,9 @@ rst_context.roles.color = function(color, str) return fmt([[\\colored[%s]{%s}]], definition, str) end +-------------------------------------------------------------------------------- --- Inofficial text roles for my private bib +-------------------------------------------------------------------------------- -- Afterthought: -- Different citation commands are essentially typographical instructions: @@ -230,7 +232,22 @@ function rst_context.roles.nocite(str) -- nocite return [[\\nocite[]] .. str .. [=[]]=] end +-------------------------------------------------------------------------------- --- End citator roles +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +--- Experimental roles. +-------------------------------------------------------------------------------- + +--- Feature request by Philipp A. +function rst_context.roles.math(str) + return [[\\mathematics{]] .. str .. [[}]] +end + +-------------------------------------------------------------------------------- +--- End roles +-------------------------------------------------------------------------------- function rst_context.interpreted_text (...) local tab = { ... } @@ -349,7 +366,8 @@ do skip1 = P"\\starttyping" * (1 - P"\\stoptyping")^1, balanced = P"{" * (V"balanced" + (1 - P"}"))^0 * P"}", skip2 = P"\\type" * V"balanced", - skip = V"skip1" + V"skip2", + skip3 = P"\\mathematics" * V"balanced", + skip = V"skip1" + V"skip2" + V"skip3", --literal = Cs(P"\\" / "") * 1 } -- cgit v1.2.3