Skip to content

colbygk/mathslax

Repository files navigation

MathSlax

A typesetting solution for all of your Slack chat needs.

Dependencies

Requires Java, nodejs and NPM.

$ sudo apt-get install nodejs npm default-jre
$ sudo apt-get install openjdk-8-jdk # unless a JDK is already installed

Set up

$ cd mathslax
$ make install
$ SERVER=myhostname.com PORT=9999 SLACK_AUTH_TOKEN="..." node server.js

Set up an outgoing web hook in Slack pointing to myhostname.com:9999/typeset (don't forget the /typeset). Use math! as the prefix. And set the outgoing token to match

Usage

In the Slack channel with the web hook configured, you should be able to typeset equations by starting your message with math!. For example, math! x^2 * sin(x) would cause the mathslax bot to comment with a link to a typeset image of x^2 * sin(x).

Slash command

You can also use this as a slash command, provided the POST URL is /slashtypeset instead of /typeset. And set the outgoing token to match

Note About Debian/Ubuntu node vs nodejs

The npm install step can produce hard to diagnose errors on Debian derived systems (such as Ubuntu 12.x and later). The binary /usr/bin/node was renamed to /usr/bin/nodejs and many packages in npm do not expect this. You can either create a link yourself from /usr/bin/node -> /usr/bin/nodejs or use one of the other various solutions out there (including attempting to use the package nodejs-legacy). Good luck!

About

Slack plugin to render math using MathJax

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published