slackr_tex: Post a tex output to a Slack channel

View source: R/slackr_tex.R

slackr_texR Documentation

Post a tex output to a Slack channel

Description

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.

Usage

slackr_tex(
  obj,
  channels = Sys.getenv("SLACK_CHANNEL"),
  token = Sys.getenv("SLACK_TOKEN"),
  ext = "png",
  path = NULL,
  title = NULL,
  initial_comment = NULL,
  thread_ts = NULL,
  ...
)

Arguments

obj

character object containing tex to compile.

channels

Comma-separated list of channel names or IDs where the file will be shared.

token

Authentication token bearing required scopes.

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.

title

Title of file.

initial_comment

The message text introducing the file in specified channels.

thread_ts

Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead.

...

other arguments passed to texPreview::tex_preview(), see Details

Details

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

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, you 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::tex_preview()


hrbrmstr/slackr documentation built on Nov. 10, 2023, 5:32 p.m.