markdown-here icon indicating copy to clipboard operation
markdown-here copied to clipboard

Inline math in Gmail is higher than the main text

Open 5nizza opened this issue 10 years ago • 4 comments

Not a bug but rather "unprettiness". The inline formulas are somewhat incontinently placed with the text: firefox

chrome

In this sense, TeX for Gmail is an example how i would like it to be: chrome-tex

And... thank you for the awesome extension!

5nizza avatar Feb 10 '15 15:02 5nizza

I'm going to switch TeX renderers in the next release, and I'll make sure to fix this.

The workaround, which is going to be very similar to the fix, is to add this to your "Primary Styling CSS" in the MDH Options:

img {
  vertical-align: bottom;
}

You can play around with other styles, but note some styles will get stripped by Gmail (etc.). For example, I tried using a negative bottom margin, and it looks great when composing, but it gets stripped when sending.

Note to self: There might be a better way of doing this in the renderer rather than in CSS.

adam-p avatar Mar 10 '15 00:03 adam-p

Changing the TeX renderer from GCharts to CodeCogs is proving to be problematic (see #261 and the bottom of #144), so that's not going to happen in the next release.

I'm hesitant to release a default CSS change before then, though, since MDH is pretty crap at dealing with such changes (#48, #78). I don't want to make style changes now that may be problematic later on.

Also note that any style fix is going to be a double-edged sword. For example...

Here's with the default vertical-align (which is baseline): image

X is good, j and your formula are too high.

Here's with vertical-align: bottom: image

X is too low, j is good, your formula is too high.

Here is with vertical-align: middle: image

I think I prefer that one, but it's really not great either: X is even lower, j is a bit low, your formula is sort of low as well.

Switching to CodeCogs might help because it provides pixel information about the image baseline. It's going to be complicated to utilize that info, though. (And we're having other issues with their image sizes being all over the place.)

I'll leave this issue open, as it's largely independent.

adam-p avatar Mar 21 '15 14:03 adam-p

Hi. Any news on this? The simple fix "vertical-align: middle" works beautifully for me, but I totally see your point of any simple change making some cases worse.

I will be willing to give a helping hand with this, since this plugin is really helping me a lot. I just wanted to ask beforehand whether there are any developments not listed in this two-years-old thread.

andyspiros avatar Jan 16 '17 13:01 andyspiros

Same here

Hi. Any news on this? The simple fix "vertical-align: middle" works beautifully for me, but I totally see your point of any simple change making some cases worse.

I will be willing to give a helping hand with this, since this plugin is really helping me a lot. I just wanted to ask beforehand whether there are any developments not listed in this two-years-old thread.

Miguel-OYeah avatar Dec 04 '19 15:12 Miguel-OYeah