add an extra escape sign for the dollar sign.......this regex world...https://stackoverflow.com/questions/9716443/how-to-escape-dollar-sign-in-a-string-using-perl-regex
diff --git a/R/magic_mirror.R b/R/magic_mirror.R
index 7b35e74..6276eae 100644
--- a/R/magic_mirror.R
+++ b/R/magic_mirror.R
@@ -89,6 +89,7 @@
 
 latex_contents_escape <- function(x) {
   x <- gsub("\\\\", "\\\\\\\\", x)
+  x <- gsub("\\$", "\\\\\\$", x)
   x <- gsub("\\(", "\\\\(", x)
   x <- gsub("\\)", "\\\\)", x)
   x <- gsub("\\[", "\\\\]", x)