Skip to content

agrajag9/slacklatex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#slack-latex

This is a Slack bot that implements a /latex slash command.

Example usage from within Slack:

/latex $ E = mc^2 $

Demo

Installation

This server requires:

On a Ubuntu server, you can install all of these with the following command:

sudo apt-get install python3-flask python3-requests texlive imagemagick

Configuring slack-latex

slack-latex requires a Slack API token (for uploading/posting the rendered formulae). It also expects you to provide a Slack slash command verification token, which allows the server to verify that requests indeed came from Slack.

Setup directories and files

Start by copying files to new places:

sudo cp slacklatex.py /usr/local/bin/
sudo cp config.ini.example /usr/local/etc/config.ini
sudo cp slacklatex.service /lib/systemd/system/
sudo mkdir -p /srv/slacklatex/

Create a bot user for your organization

Go to https://my.slack.com/services/new/bot and create a new bot. Ours is named latex-bot.

Once you've created the bot, copy the API Token from the Integration Settings into the bot_user_api_token field in your config.ini.

Feel free to configure your bot as you see fit (name, avatar, etc).

Create a slash command for your organization

Go to https://my.slack.com/services/new/slash-commands and create a new slash command. We recommend /latex.

Set the URL to the url you plan to run this server from. Make sure your port matches the one in main.py.

Copy the verification token from Integration Settings -> Token into config.ini as the slash_command_verification_token value.

Daemonize your slack LaTeX bot

Don't forget to register and enable the slacklatex service with systemd!

sudo systemctl daemon-reload
sudo systemctl enable slacklatex.service

Start your bot!

sudo systemctl start slacklatex.service

About

A slack bot for rendering LaTeX formulas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.0%
  • TeX 6.0%