RegInlineMath |
= |
/\${1}((?:[^\$]|\\\$)+)\$/ |
|
Everything goes; takes care of escaping the "\$" inside the
expression
|
MathOpen1 |
= |
Regexp.escape('\\begin{equation}') |
MathClose1 |
= |
Regexp.escape('\\end{equation}') |
EquationOpen |
= |
/#{MathOpen1}|#{MathOpen2}|#{MathOpen3}/ |
EquationClose |
= |
/#{MathClose1}|#{MathClose2}|#{MathClose3}/ |
EquationStart |
= |
/^[ ]{0,3}(#{EquationOpen})(.*)$/ |
|
$1 is opening, $2 is tex
|
EquationEnd |
= |
/^(.*)(#{EquationClose})\s*#{EqLabel}?\s*$/ |
|
$1 is tex, $2 is closing, $3 is tex
|
OneLineEquation |
= |
/^[ ]{0,3}(#{EquationOpen})(.*)(#{EquationClose})\s*#{EqLabel}?\s*$/ |
|
$1 is opening, $2 is tex, $3 is closing, $4 is label
|
RegEqrefLatex |
= |
/\\eqref\{(\w+)\}/ |
|
This adds support for \eqref
|
RegEqref |
= |
Regexp::union(RegEqrefLatex, RegEqPar) |
RegRef |
= |
/\\ref\{(\w*)\}/ |
|
This adds support for \ref
|