#slack-latex
This is a Slack bot that implements a /latex
slash command.
Example usage from within Slack:
/latex $ E = mc^2 $
This server requires:
- Flask
- Requests
pdflatex
from TeXLiveconvert
from imagemagick
On a Ubuntu server, you can install all of these with the following command:
sudo apt-get install python3-flask python3-requests texlive imagemagick
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.
Start by copying the example config file:
cp config.ini.example config.ini
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).
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.
Start up your server:
python3 main.py
Then, try testing out your shiny new slash command.