add linebreak
diff --git a/R/linebreak.R b/R/linebreak.R
new file mode 100644
index 0000000..adf5e95
--- /dev/null
+++ b/R/linebreak.R
@@ -0,0 +1,18 @@
+#' Make linebreak in LaTeX Table cells
+#'
+#' @export
+linebreak <- function(x, align = c("l", "c", "r"), double_escape = F) {
+ if (is.numeric(x) | is.logical(x)) return(x)
+ align <- match.arg(align, c("l", "c", "r"))
+ if (double_escape) {
+ ifelse(str_detect(x, "\n"),
+ paste0("\\\\makecell[", align, "]{",
+ str_replace_all(x, "\n", "\\\\\\\\\\\\\\\\"), "}"),
+ x)
+ } else {
+ ifelse(str_detect(x, "\n"),
+ paste0("\\makecell[", align, "]{",
+ str_replace_all(x, "\n", "\\\\\\\\"), "}"),
+ x)
+ }
+}