Skip to content

MatthewBhattacharya/LatexIt

 
 

Repository files navigation

Latex It!

Description

This extension runs local latex and dvipng binaries to convert $...$ and $$...$$ expressions into inline images while composing HTML emails in Thunderbird.

The add-on now uses the MailExtension + Experiment API model and targets Thunderbird 140+.

Features

  • Run LaTeX conversion on all matching expressions in a compose window
  • Undo / undo all inserted images
  • Insert complex LaTeX at cursor position
  • Configure executable paths, template, DPI behavior, and debug/log options
  • Auto-detect latex and dvipng in your PATH
  • Auto-fallback to local helper service for sandboxed Thunderbird installs

Requirements

  • Thunderbird 140 or newer
  • A local TeX setup with:
    • latex
    • dvipng
  • For sandboxed Thunderbird (Snap/Flatpak), use the local helper service. Preferred on Linux: install it as a systemd --user service.

Build

Run:

make

This produces tblatex.xpi.

Install

  1. Build the extension:
make
  1. In Thunderbird, open Add-ons and Themes.
  2. Click the gear icon and choose Install Add-on From File....
  3. Select tblatex.xpi.
  4. Open LaTeX It! options and confirm latex / dvipng paths (or click autodetect).
  5. If Thunderbird is sandboxed, enable helper fallback in options and make sure helper URL matches your helper service.

Publishing a fork on ATN

If you are publishing your own fork (not updating the original add-on listing), build with a unique add-on ID:

make ADDON_ID='tblatex@your-domain-or-handle.example' OUT='tblatex-fork.xpi'

Upload tblatex-fork.xpi to ATN. This avoids "Duplicate add-on ID found."

Development install (temporary)

  1. In Thunderbird, open Tools -> Developer Tools -> Debug Add-ons.
  2. Click Load Temporary Add-on....
  3. Select this repository's manifest.json.

Usage Notes

  • Conversion works in HTML compose mode.
  • In a compose window, use the LaTeX It! compose action menu and click Run LaTeX in body.
  • This converts expressions like $\frac{2}{3}$ and $$\boxed{\frac{34}{31}}$$ into inline PNG images.
  • Default shortcut for silent conversion: Ctrl+Shift+L (Cmd+Shift+L on macOS).

Sandbox Fallback (Snap/Flatpak)

Primary option (Linux): install helper as a user service

bash helper/install-systemd-user.sh

Fallback option: run helper manually

python3 helper/tblatex_helper.py

Then in extension options:

  • Enable local helper fallback.
  • Set helper URL to http://127.0.0.1:3737 (or your custom host/port).
  • Click Test helper.

When direct binary execution is blocked by sandboxing, LaTeX It! will automatically route rendering through the helper.

About

An extension for Thunderbird that allows you to generate LaTeX in your emails and send it as inline images

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 76.1%
  • Python 10.8%
  • HTML 5.4%
  • Shell 4.6%
  • CSS 2.6%
  • Makefile 0.5%