/InLaTeXbot

Customizable LaTeX bot for Telegram messenger

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Inline LaTeX bot for Telegram messenger to send pictures with any LaTeX content to anyone from any device. Find it here: http://t.me/InLaTeXbot.

Description and general usage

This bot converts LaTeX expressions to .png images when called in inline mode (@inlatexbot <your expression>) and then shows you the image it has generated from your code. Everything happens live, so you can just gradually type and continuously monitor the result. When expression contains errors, they will be displayed instead of the image. Finally, when you are ready, click or tap the suggested picture to send it.

Since v2.0 the bot also supports direct conversion of LaTeX expressions in a conversation. You can send it messages containing the code, and it will respond with a .pdf file and an image containing the expression. This allows larger (than in the inline mode) expressions to be converted; moreover, .pdf file contains graphics in vector format, so further processing of the expression in a VG application, i.e. in Inkscape, is possible.

Customization

The main feature of the bot is the customizable preamble used in the document into which your expression will be inserted:

\documentclass{article}
\usepackage[T1]{fontenc}
...
%You can modify everything above this comment
\begin{document}
<your expression goes here>
\end{document}

This means you can inlude the packages that you need or define your own expressions and commands which will be afterwards available in the inline mode. The bot uses full installation of Texlive2016, so any of its packages should be within the bot's reach.

Additionally, it is possible to change how the messages will look like after they've been sent, i.e. include the raw expression in the caption of the image or not, or set the resolution of the picture to control its size.

The customization applies both to the inline and standard modes.

Limitations

The expression length is limited by the length of the inline query to approximately 250 characters (despite the statement in the API docs that inline queries can span up to 512 characters)

The preamble length is currently limited by 4000 characters as the longest messages that Telegram can send in one piece are of 4096 chars.

Bot should be currently online, so in case it's down it's either maintenance or some emergency. Also, feel free to open an issue if you find a bug or contact me directly in Telegram should you have any related questions.

Support the project

https://www.donationalerts.com/r/glebfedorov