Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8853c79
Port add-on to Thunderbird 140+ MailExtension
andrewboldi Feb 20, 2026
fa0566a
Accept symlinked latex executable paths
andrewboldi Feb 20, 2026
4a520c4
Harden executable path detection and normalization
andrewboldi Feb 20, 2026
140594f
Document and hint Snap confinement limitation
andrewboldi Feb 20, 2026
f12f176
Add sandbox helper fallback for local LaTeX rendering
andrewboldi Feb 20, 2026
beba8e1
Make systemd helper service the primary setup path
andrewboldi Feb 20, 2026
4f67cb9
ignore claude files
andrewboldi Feb 20, 2026
03a76f6
Disable run-report logging by default
andrewboldi Feb 20, 2026
a2773ba
Fix validator requirements for Thunderbird experiment upload
andrewboldi Feb 20, 2026
a76ece4
Use Thunderbird applications.gecko version range
andrewboldi Feb 20, 2026
fe7e4d2
Add custom add-on ID build option for fork publishing
andrewboldi Feb 20, 2026
0e0aa37
Fix base64 encoding in experiment context without btoa
andrewboldi Feb 20, 2026
2cfbdea
Fix direct renderer stability and compose caret behavior
andrewboldi Feb 20, 2026
1fc8265
update extension
andrewboldi Feb 20, 2026
432bac7
Disable run report by default
andrewboldi Feb 20, 2026
46fbdd8
Remove compose run reports before send
andrewboldi Feb 20, 2026
da26dcc
update
andrewboldi Feb 20, 2026
efa324b
Improve formula image quality without changing display size
andrewboldi Feb 20, 2026
efcb3d0
Add configurable render scale with 4x default
andrewboldi Feb 20, 2026
3667360
Restore complex edit flow and add send-time LaTeX warning
andrewboldi Feb 22, 2026
ed8551c
Add robust inline and complex formula edit-after-insert
andrewboldi Feb 22, 2026
1aa36c2
Add recent formula history picker in insert dialog
andrewboldi Feb 22, 2026
8f07b1a
Add optional persistent formula history across compositions
andrewboldi Feb 22, 2026
fa663f1
Improve insert dialog usability and persist popup size
andrewboldi Feb 25, 2026
77526ba
Remove obsolete legacy XUL extension files
andrewboldi Feb 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.claude
CLAUDE.md
42 changes: 42 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
--v0.8.16

- Added a settings option to persist recent formula history across compose windows.
- Persistent history is now stored locally when enabled and reused by new compose sessions.
- Keeps session-only behavior by default when persistent history is disabled.

--v0.8.15

- Added a recent-formulas history list in the Insert Complex LaTeX dialog.
- Added load/refresh actions to reuse and edit previously rendered formulas.
- Tracks both inline and complex formulas in compose-session history with de-duplication.
- Keeps robust metadata recovery for formulas selected from the message body.

--v0.8.14

- Added edit-after-insert support for inline LaTeX formulas rendered from body markers.
- Improved formula-source persistence by storing mode, expression, and full document metadata.
- Added resilient edit-source recovery from image data attributes with alt/title fallback.
- Improved insert dialog behavior to preload selected formula source for in-place replacement.

--v0.8.13

- Added a send-time warning when unconverted LaTeX markers remain in the compose body.
- Added a setting to enable/disable the unconverted-LaTeX send warning.
- Restored editable "Insert complex LaTeX" flow by reusing the last complex input.
- Preserved complex source data on inserted images so selected formulas can be edited.

--v0.8.1

- Added automatic local-helper fallback for sandboxed Thunderbird builds (Snap/Flatpak).
- Added helper runtime detection and helper health checks in options UI.
- Added `helper/tblatex_helper.py` service for out-of-sandbox LaTeX rendering.
- Added Linux `systemd --user` install/uninstall scripts for helper auto-start.

--v0.8.0

- Ported add-on to Thunderbird 140+ MailExtension architecture.
- Replaced legacy XUL overlay integration with compose action + compose scripts.
- Added a Thunderbird experiment API to run local latex/dvipng binaries.
- Replaced XUL options/insert dialogs with HTML options and popup dialogs.
- Added migration of existing legacy tblatex.* user preferences.

--vX.Y.Z

- Improvements in the generated .png bitmaps: Transparent background
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
EXCLUDES = $(addprefix --exclude , $(shell find . -iname '.*.sw*'))
ADDON_ID ?=
OUT ?= tblatex.xpi

all: dist

.PHONY: dist
.PHONY: dist clean
dist:
./scripts/build_xpi.sh "$(OUT)" "$(ADDON_ID)"

clean:
rm -f tblatex.xpi
zip tblatex.xpi $(EXCLUDES) --exclude Makefile --exclude TODO --exclude icon.xcf --exclude tblatex.xpi -r *
112 changes: 102 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,109 @@ Latex It!
Description
-----------

This extension allows you to run LaTeX on your computer to automatically
generate images for all expression $expr$ found while composing your email. You
can also render possibly more complex sets of LaTeX, and have them inserted as
images. You can undo the LaTeX run if the formulae you inserted were wrongly
typeset, and you can customize the appearance of your formulae.
This extension runs local `latex` and `dvipng` binaries to convert `$...$` and
`$$...$$` expressions into inline images while composing HTML emails in
Thunderbird.

Since everything is run on your own computer, you're in control!
The add-on now uses the MailExtension + Experiment API model and targets
Thunderbird **140+**.

Usage
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
-----

This extension is provided as a set of files. Please run make to build a working
xpi. Alternatively, you can create a file named "tblatex@xulforum.org" in your
extensions/ directory with a single line containing the path to this folder.
Run:

```sh
make
```

This produces `tblatex.xpi`.

Install
-------

1. Build the extension:

```sh
make
```

2. In Thunderbird, open `Add-ons and Themes`.
3. Click the gear icon and choose `Install Add-on From File...`.
4. Select `tblatex.xpi`.
5. Open `LaTeX It!` options and confirm `latex` / `dvipng` paths (or click autodetect).
6. 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:

```sh
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

```sh
bash helper/install-systemd-user.sh
```

Fallback option: run helper manually

```sh
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.
Loading