Skip to contents

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

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.

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

Jonathan Sidi (aut)