protz / LatexIt

An extension for Thunderbird that allows you to generate LaTeX in your emails and send it as inline images
http://www.xulforum.org/go_code
37 stars 16 forks source link

Faulty vertical spacing #63

Closed SimonApers closed 3 years ago

SimonApers commented 3 years ago

Hi, Combining Latex It! with Ubuntu 20.04 and Thunderbird 68.10.0 I get a weird vertical spacing. I'm attaching a screenshot of how the rendering goes (for an expression between dollar-signs). The vspace seems to be in the (html?) embedding, not in the png, which has the right dimensions. I can get around the issue by manually downgrading to version 0.6.8, and disabling updates. For this version I also have to change the ImageMagick policy lines.

Thanks in advance! And ofcourse thank you so much for a great addon.

Best, Simon

Screenshot from 2020-10-01 09-29-51

sphh commented 3 years ago

Thanks for filing this issue.

A little background: The new version 0.7.x aligns the generated picture with the surrounding text (see #36) and I guess that's where it goes wrong. It uses the --depth option of dvipng (https://tug.org/texinfohtml/dvipng.html#index-depth-reporting).

To help tracking down the problem, it would be helpful to see the debug output of LatexIt. You can enable it in the add-ons settings page (☰ > Add-ons > Latex It!). Please tock both Generate a log report and Generate debug info and rerun LatexIt. This should show some info directly in the mail message you are editing. (Get rid of it by clicking on the x in the top right corner of the box containing the log.)

Maybe you can show a screenshot of the settings dialog as well?

SimonApers commented 3 years ago

Thanks for the quick reply! Directly in the mail message there wasn't much extra info (note that the second time I compile $x^2$ I don't get the bug): Screenshot from 2020-10-01 10-35-08 The debugger window does show some errors: Screenshot from 2020-10-01 10-35-36 Finally, here are the settings (I commented out the additional packages that I use): Screenshot from 2020-10-01 10-35-59

SimonApers commented 3 years ago

For your information, here's what the terminal says after using Latex It: Screenshot from 2020-10-01 10-41-11

sphh commented 3 years ago

Indeed, that run report does not report much at all …

In your Template can you please replace the line

\usepackage[utf8x]{inputenc}

with the two following lines:

\usepackage[utf8]{inputenc}
\usepackage[active,displaymath,textmath]{preview}

and try to re-run it.

I cannot spot any message related to LatexIt in Thunderbird's debugger window.

SimonApers commented 3 years ago

Amazing, that seems to solve it!

sphh commented 3 years ago

Well, it's not that amazing, since dvipng --depth requires the preview package. BTW you should now see your formulae nicely aligned with the surrounding text.

The template is automatically updated, if the user has not changed it (https://github.com/protz/LatexIt/pull/58#issuecomment-655210410).

Changing utf8x to utf8 is just reducing some dependencies on the Debian system (see #8), so had not a direct impact on your problem.

@protz: I guess, we might get more of this. Is it possible to issue a warning when updating the add-on?

sphh commented 3 years ago

The reason, why the second run in https://github.com/protz/LatexIt/issues/63#issuecomment-701983427 "worked" is a result of bug #64.

sphh commented 3 years ago

Solved in PR #67.

sphh commented 3 years ago

The version 0.7.3 hit the Thunderbird add-on repository, so this can be closed.