diff --git a/ruler.cabal b/ruler.cabal
--- a/ruler.cabal
+++ b/ruler.cabal
@@ -1,5 +1,5 @@
 Name:                ruler
-Version:             0.4.0.1
+Version:             0.4.0.2
 Copyright:           Utrecht University, Department of Information and Computing Sciences, Software Technology group
 Description:         Ruler tool used by UHC (Utrecht Haskell Compiler)
 Synopsis:            Ruler tool for UHC
diff --git a/src/AS2/Pretty.cag b/src/AS2/Pretty.cag
--- a/src/AS2/Pretty.cag
+++ b/src/AS2/Pretty.cag
@@ -166,8 +166,10 @@
 %%[1 ag
 SEM RlDecl
   | LTX             lhs     .   pp          =   let r = "\\" >|< (pcRule @lhs.ppCfg) >|< ppCurly @rlNm >|< ppCurly @vwNm
-                                                        >-< ppBlockWithStrings "{%" "}" "\\\\" @preJds.ppL
-                                                        >-< ppBlockWithStrings "{%" "}" "\\\\" @postJds.ppL
+                                                        >-< (ppBlockWithStrings "{ " " }" "\\\\" $ {- map ensureTeXMath -} @preJds.ppL)
+                                                        >-< (ppBlockWithStrings "{ " " }" "\\\\" $ {- map ensureTeXMath -} @postJds.ppL)
+                                                        -- >-< ppBlockWithStrings "{%" "}" "\\\\" @preJds.ppL
+                                                        -- >-< ppBlockWithStrings "{%" "}" "\\\\" @postJds.ppL
                                                 in  mkTexCmdDef (pcDef @lhs.ppCfg) @nm r
   | LTXAlias        lhs     .   pp          =   mkTexCmdDef (pcDef @lhs.ppCfg) @fullAliasNm (mkTexCmdUse (pcUse @lhs.ppCfg) @fullNm)
 
