Last chance! 50% off unlimited learning
Sale ends in
Unlike the slackr_dev()
function, this one takes a tex
object,
eliminating the need write to pdf and convert to png to pass to slack.
slackr_tex(
obj,
channels = Sys.getenv("SLACK_CHANNEL"),
bot_user_oauth_token = Sys.getenv("SLACK_BOT_USER_OAUTH_TOKEN"),
ext = "png",
path = NULL,
...
)
character object containing tex to compile
list of channels to post image to
the Slack full bot user OAuth token (chr)
character, type of format to return, can be tex, pdf, or any image device, Default: 'png'
character, path to save tex_preview outputs, if NULL then tempdir is used, Default: NULL
other arguments passed to texPreview::tex_preview()
, see Details
httr
response object (invisibly)
Please make sure texPreview
package is installed before running this function.
For TeX setup refer to the
Setup notes on LaTeX
.
# NOT RUN {
slackr_setup()
obj <- xtable::xtable(mtcars)
slackr_tex(obj,
print.xtable.opts = list(scalebox = getOption("xtable.scalebox", 0.8)))
slackr_tex(obj,
ext = "pdf",
print.xtable.opts = list(scalebox = getOption("xtable.scalebox", 0.8)))
slackr_tex(obj,
ext = "tex",
print.xtable.opts = list(scalebox = getOption("xtable.scalebox", 0.8)))
slackr_tex(obj,
path = "testdir",
print.xtable.opts = list(scalebox = getOption("xtable.scalebox", 0.8)))
# }
Run the code above in your browser using DataLab