-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install sequence #1
Comments
It's been a while since I set this up, so I'm going to list out everything that I can remember to cover all the bases. You'll need to set up two things in Slack: a slash command and a custom incoming webhook. The slash command tells slack that when someone types something like "host": "example.com",
"port": 8000,
"request_path": "/latex", When you set up the slash command in slack, it will also have a field for a token. Whatever value this field is you'll want to put in the "token": "e9T1Qw5YMztq21gVf0dw83La",
"command": "/latex" So when someone enters their slash latex command, slack makes a request to the url you configured, and this code generates the PNG image and puts the image in The next part requires that you also have a web server installed, like Apache or nginx. After the PNG image is created, this code will POST back to slack. This is where you'll need to configure the Incoming Webhook in slack. For the most part, you don't need to worry about the configuration options in slack for this. Set a name, description, perhaps add an image and copy the webhook url that it gives you. Put that url into the The full config would then be: {
"server": {
"host": "example.com",
"port": 8000,
"request_path": "/latex",
"output_path": "/images",
"output_dir": "/home/bjester/slacktex/images",
"temp_dir": "/tmp"
},
"slack": {
"token": "e9T1Qw5YMztq21gVf0dw83La",
"command": "/latex",
"webhook_url": "https://hooks.slack.com/services/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"
},
"png": {
"bin": "/usr/bin/dvipng"
},
"tex": {
"bin": "/usr/bin/latex",
"template": "./resource/template.tex"
}
} A couple other things:
I hope this helps and that slack works out for you. Slack never really caught on with my university's physics group. |
Hi bjester: We're a University research group looking to use slack with latex and after I've installed node and slacktex, I'm unsure what has to change in the config file. If I understand correctly, image files are generated via the local latex package, stored on a remote host then loaded into the slack thread using HTTP. So in the config file "default.json" we need to sub "example.com" with "myuniv.edu/mysubdomain/mystoragefolder" ? Basically not sure what to set for all of the "server" parameters in our case or even "latex" -- would set "command" to "/latex" for example? Thanks for any help here, we would love to share latex formulas in our threads. jwinkle
The text was updated successfully, but these errors were encountered: