TeXSend is a suite of userscripts which allow you to compile LaTeX code in your favorite email services.
Everything that is on the KaTeX Support Table is supported by these userscripts. That includes all standard equation elements, matrices, arrays, and lots more.
Important
- This does not change the content of emails in any way. Email recipients will also need to run a userscript from this suite if they wish to compile on their end.
- The compiling is performed entirely locally - the content of emails is not transmitted to any server.
- As userscripts, these have not undergone any third party verificiation. You are encouraged to audit the code and disable automatic updates if you have concerns.
🔧 Installation Guide:
This requires the use of a browser script manager. Some examples are listed below, but in principle any browser script manager should function.
For example, in Chrome: [Puzzle Piece Icon] > Manage Extensions > Tampermonkey / Details > Allow User Scripts
Once you have a browser script manager extension installed on your browser, click the following link for your email service:
Lastly,
- On the new tab, click "Install" (on the left for Violentmonkey)
- Refresh any open tabs for your email service
✍️ Use Guide:
LaTeX code is compiled automatically upon opening an email or expanding an email in a chain. To toggle it off (or back on), click the
Ctrl+Alt+L
shortcut to toggle compiling in an email chain.
LaTeX code is not compiled automatically in drafts, but can be toggled on by clicking the
Ctrl+Alt+K
shortcut to toggle compiling in an active draft.
KaTeX-supported environments (i.e. anything on their list which is surrounded with braces {}
) (e.g. \begin{bmatrix}
and \begin{array}
) can be used at any place in an email. In addition to these, a set of additional delimiters have been added to allow you to create inline and display math environments with ease.
- Inline mode:
$...$
[; ... ;]
\( ... \)
\begin{math} ... \end{math}
- Display mode:
$$...$$
[(; ... ;)]
\[ ... \]
\begin{displaymath} ... \end{displaymath}
🔛 Note that the default state of TexSend (i.e., whether it automatically enables render upon loading your email service) can be toggled by clicking "Toggle Default State" within your chosen browser script manager. This was implemented to accomodate user choice between avoiding messing up emails that don't contain any TeX but happen to contain delimiters (most notably, $), and the convenience of not having to toggle on LaTeX compiling on every load-in.
💲 Note that $ and $$ delimiters are enabled by default, but can be toggled by clicking "Toggle $ & $$ Delimiters" within your chosen browser script manager. This was implemented to accomodate emails that may contain references to multiple dollar currency amounts while also containing LaTeX not in dollar sign delimiters. There are still edge cases that this won't solve, like if the LaTeX is also in dollar sign delimiters, but it's as good of a solution as could be conceived.
💡 Use \displaystyle
inside inline delimiters to compile as display mode with line breaks.
\(\displaystyle E=mc^{2}\)
Inside of a supported environment, you can use any of the many other functions provided by KaTeX (e.g. \alpha
and \brack
).
⚙️ Development:
If you would like to contribute, these fixes & additions are the current priorities (but suggestions are welcome):
- 🐛 Bugs:
- No known bugs at this time! 😄
- 💎 Features:
- Support for other popular email services
- Each email service would be an independent userscript, not all in one.
- Outlook
- iCloud
- Yahoo
- Thunderbird - I think it may be possible w/ this add-on
- Protonmail
- AOL
- GMX
- Libero
- Zoho
- Naver
- QQ Mail
- Line Mail
- Rediffmail
- Yandex
- Each email service would be an independent userscript, not all in one.
- Support for other popular email services
- 🪢 Stretch Goals:
- Convert the entire TeXSend suite into a browser extension compatible with all major browsers.
- Add TikZJax support.
- npmjs - src folder currently missing tikzjax.js
- TikZ uses
\begin{tikzpicture}
delimiters.
- Add LaTeX.js support.
- This was briefly toyed with, but only partial support with lots of issues was achieved.
- It seems the ideal would be to still use KaTeX for math environments, and TikZJax for TikZ envionrments, but LaTeX.js would be useful for general formatting.
- This was briefly toyed with, but only partial support with lots of issues was achieved.
Special thanks to the KaTeX organization - without which, this would not be possible.