Slack Latex



Slack

I just joined a new Slack workspace, and was growing weary of using the codecogs equation editor just to paste in an image of some latex math into Slack.
It took a bit of effort, but I thought I would document the process for anyone who is curious.

Download mac os for amd. You need:
– Slack, obviously
– A Linux server, accessible from anywhere
– Familiarity with some command line

I have a digital ocean droplet hosting this webpage, running Ubuntu 16.04.

Slack

First, SSH into your server.

Second, you will probably need an updated version of node.

Black Dress Pants Cheap

Third, get mathslax ready.

Fourth, navigate to slack chat -> Workspace name -> Customize slack -> Apps -> Search for Slash Commands, install that integration.
Go to Custom Integrations -> Slash Commands ->Add Configuration
Enter some settings:

yourServerName should be your webpage name; e.g., mine is srmart.in

Download Slack for free for mobile devices and desktop. Keep up with the conversation with our apps for iOS, Android, Mac, Windows and Linux. Create a secret.txt file in the bot directory and put your slack app token in it. Start bot by running node bot.js or nodejs bot.js; With docker. Make sure docker is installed. Create a secret.txt file in the bot directory and put your slack app token in it. Run docker build -t slacklatex. To build the docker image. Awesome screenshots for mac. Slack is a new way to communicate with your team. It’s faster, better organized, and more secure than email. App surfaces — such as messages, modals, or Home tabs — can contain all types of textual treasures. The Block Kit elements that form the layouts for these surfaces frequently use text objects to insert all kinds of content. These text objects can be left as unformatted plaintext, or formatted with mrkdwn to create useful visual highlights or avail of syntax to trigger special parsing. You can even discuss math with your teammates using LaTex. Team chats do not have to be serious all the time; lighten up your team’s mood with funny emoji reactions. It uses a drag-and-drop feature that you can use while uploading files. It offers Markdown code blocks along with syntax highlighting to discuss codes with your team.

yourConfiguredPortNumber should be the port that the mathslax server will listen on. E.g., 7777

Write down or copy the Token that is generated for you.

Ladies Wool Dress Slacks

Fifth, in your SSH session or server, create a simple script for launching the mathslax server

Save that to /usr/local/bin/tex.sh, and mark as executable

Sixth, move mathslax to a location. I did not follow best practices; this should probably be in /opt, /usr/share, or some other directory, but whatever.

Finally, create a systemd services script, and place it in /etc/systemd/system/mathslax.service

Then:

You may need to enable the port in your firewall. If using UFW, then it’s simply sudo ufw allow yourConfiguredPortNumber

In slack, you can then type:

Petite Women's Wool Slacks

And get an image of those three aligned sampling statements.

Part two. The bot method.

On your server,

Create a file /usr/local/bin/texbot.sh with:

Create a file /etc/systemd/system/SlackLateX.service with:

Go to your slack chat workspace -> Apps -> Install Slack bots -> Add configuration:

Copy the API token, paste it into /usr/local/bin/SlackLateX/secret.txt

Then simply invite latexbot into the channel, and start the bot sudo systemctl start SlackLateX

Now you can type $pi$ to get a rendering of the pi symbol (or any other latex equation). This method improves upon the first method because it’s channel-specific, and you can edit latex code, which will re-render.

After using www.randomcoffees.com successfully for a while we started receiving errors such as:

Slack Latex Plugin

I know www.randomcoffees.com are working on this, but it also meant that we were not getting any coffee dates, so I wrote a very simple random coffee bot for slack that takes all the members in a channel and randomly matches them up for a coffee date, and writes the matches back in the same channel. We run it weekly in a scheduler, but could it also be called manually. The implementation is fairly simple and looks back in the channel history to find previous matches (history was added 2020-03-28).

When www.randomcoffees.com works again I would recommend using this again as it lots less work than maintaining this code, but for now, it is a drop-in replacement.

The code is available here:

Related