tex_slackr: Post a tex output to a Slack channel

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/tex_slackr.R

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

1
2
3
tex_slackr(obj, channels = Sys.getenv("SLACK_CHANNEL"),
  api_token = Sys.getenv("SLACK_API_TOKEN"), ext = "png", path = NULL,
  ...)

Arguments

obj

character object containing tex to compile

channels

list of channels to post image to

api_token

the Slack full API token (chr)

ext

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

path

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

...

other arguments passed to texPreview

Value

httr response object (invisibly)

Note

You need to setup a full API token (i.e. not a webhook & not OAuth) for this to work Also, uou can pass in add_user=TRUE as part of the ... parameters and the Slack API will post the message as your logged-in user account (this will override anything set in username)

Author(s)

Jonathan Sidi [aut]

See Also

texPreview print.xtable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)))

## End(Not run)

hrbrmstr/slackr documentation built on May 18, 2018, 4:19 p.m.