Skip to content

TeXSend is a suite of userscripts which allow you to compile LaTeX code in your favorite email services.

License

Notifications You must be signed in to change notification settings

LoganJFisher/TeXSend

Repository files navigation

TeXMail

Gmail Outlook iCloud Yahoo Thunderbird Protonmail AOL And more
License PRs Discussions

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 to compile on their end.
  • The compiling is performed entirely locally - the content of emails is not transmitted to any server.

🔧 Installation Guide:

This requires the use of a browser script manager. Violentmonkey is recommended, but other options should also be compatible.

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 $\TeX$ button on the action bar at the top of the email.
$~~~~$:accessibility: 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 $\TeX$ button in the action bar at the bottom of the draft. Editing is disabled while compile is on.
$~~~~$:accessibility: 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.

$~~~~$Additional supported math environment delimiters beyond KaTeX:

  • Inline mode:
    • [; ... ;]
    • \( ... \)
    • \begin{math} ... \end{math}
  • Display mode:
    • [(; ... ;)]
    • \[ ... \]
    • \begin{displaymath} ... \end{displaymath}

💡 Use \displaystyle inside inline delimiters to compile as display mode with line breaks.
$~~~~~~$ Example: \(\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).

Example of TeXSend in action (in Gmail)


⚙️ 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.
  • 🪢 Stretch Goals:
    • 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.

Special thanks to the KaTeX organization - without which, this would not be possible.

About

TeXSend is a suite of userscripts which allow you to compile LaTeX code in your favorite email services.

Topics

Resources

License

Stars

Watchers

Forks