Initial commit
diff --git a/R/iflatex.R b/R/iflatex.R
new file mode 100644
index 0000000..35b1bef
--- /dev/null
+++ b/R/iflatex.R
@@ -0,0 +1,19 @@
+#' Return latex control text if rendering latex
+#'
+#' @param txt
+#'
+#' @return a string
+#' @export
+#'
+#' @examples
+#' \dontrun{
+#' iflatex("\\vspace*{\\fill}")
+#' }
+#'
+iflatex <- function(txt){
+  if (knitr::opts_knit$get("rmarkdown.pandoc.to") == "latex"){
+    return(txt)
+  } else {
+    return("")
+  }
+}
\ No newline at end of file