Learn R Programming

slackr (version 2.0.1)

tex_slackr: Post a tex output to a Slack channel

Description

Unlike the dev_slackr function, this one takes a tex object, eliminating the need write to pdf and convert to png to pass to slack.

Usage

tex_slackr(
  obj,
  channels = Sys.getenv("SLACK_CHANNEL"),
  bot_user_oauth_token = Sys.getenv("SLACK_BOT_USER_OAUTH_TOKEN"),
  ext = "png",
  path = NULL,
  ...
)

Arguments

obj

character object containing tex to compile

channels

list of channels to post image to

bot_user_oauth_token

the Slack full bot user OAuth token (chr)

ext

character, type of format to return, can be tex, pdf, or any image device, Default: 'png'

path

character, path to save tex_preview outputs, if NULL then tempdir is used, Default: NULL

...

other arguments passed to tex_preview, see Details

Value

httr response object (invisibly)

Details

Please make sure texPreview package is installed before running this function. For TeX setup refer to the Setup notes on LaTeX.

See Also

tex_preview print.xtable

Examples

Run this code
# NOT RUN {
slackr_setup()
obj=xtable::xtable(mtcars)
tex_slackr(obj,print.xtable.opts=list(scalebox=getOption("xtable.scalebox", 0.8)))

tex_slackr(obj,ext = 'pdf',print.xtable.opts=list(scalebox=getOption("xtable.scalebox", 0.8)))

tex_slackr(obj,ext = 'tex',print.xtable.opts=list(scalebox=getOption("xtable.scalebox", 0.8)))

tex_slackr(obj,path='testdir',print.xtable.opts=list(scalebox=getOption("xtable.scalebox", 0.8)))
# }

Run the code above in your browser using DataLab