R/addIns.R

Defines functions untex_table unbreak_lines texToRmd

texToRmd <- function() {
  context <- rstudioapi::getActiveDocumentContext()
  where <- rstudioapi::primary_selection(context)
  rstudioapi::insertText(where$range,
                         translate_tex(where$text),
                         context$id)
}

unbreak_lines <- function() {
  context <- rstudioapi::getActiveDocumentContext()
  where <- rstudioapi::primary_selection(context)
  rstudioapi::insertText(where$range,
                         simplify_paragraphs(where$text),
                         context$id)
}

untex_table <- function() {
  context <- rstudioapi::getActiveDocumentContext()
  where <- rstudioapi::primary_selection(context)
  rstudioapi::insertText(where$range,
                         latex2md_tables(where$text),
                         context$id)
}
dtkaplan/detex documentation built on July 6, 2017, 8:12 p.m.