Discussion:
math, png: TeX for Gmail, not shown in GNU Emacs.
Uwe Brauer
2015-09-12 08:10:02 UTC
Permalink
Hello

I asked something similar 1 year ago but meanwhile I have (at least
partially) switched from Xemacs 21.5.34 mule to GNU Emacs 25, using
ma-gnus 0.9. The problem I am to describe was not solvable for Xemacs
but I seem to remember that it was for GNU Emacs. However right now for
my current setting the display of the messages in question is not correct.

Situation:

I receive html-email generated by gmail using the «TeX for Gmail»
extension, which like latexit for thunderbird, or org-mime-htmlize for
Emacs converts latex formula to png. Actually I receive a lot of them
and their correct display is important for me.

However while this message is displayed correctly in

- gmail itself using firefox,

- thunderbird,

- it is not so (any longer, at least not in my setting) for GNU
Emacs.

I use mm-text-html-renderer 'gnus-w3m
and played around with
(setq gnus-mime-display-multipart-related-as-mixed nil)
(setq gnus-mime-display-multipart-as-mixed nil)

Or set to t.

I attach 4 screen shots
1. Firefox+gmail
2. Thunderbird
3. GNU Emacs with gnus-mime-display-multipart-as-mixed nil
4. GNU Emacs with gnus-mime-display-multipart-as-mixed t

I recall that somebody on the list told me he could see such embedded
png. I would love to hear about it and which setting I have to use.


Thanks very much

Uwe Brauer
Adam Sjøgren
2015-09-12 10:48:56 UTC
Permalink
I receive html-email generated by gmail using the «TeX for Gmail»
extension, which like latexit for thunderbird, or org-mime-htmlize for
Emacs converts latex formula to png.
Do you by any chance have any of these variables set to not show HTML:

mm-discouraged-alternatives
mm-automatic-display

?

Have you tried using shr as the HTML renderer? I.e. leaving
mm-text-html-renderer at its default value?

Have you customized mm-automatic-display?

What have you set mm-inline-text-html-with-images to?

And if you keep using w3m, what is mm-w3m-safe-url-regexp set to?


Those are the variables I have touched in my config; maybe one if the
holds the key.


:-),

Adam
--
"We're not unreasonable, I mean, noone's going to eat Adam Sjøgren
your eyes" ***@koldfront.dk
Uwe Brauer
2015-09-12 12:45:53 UTC
Permalink
Hi

I remember now it was you who said you could see those png!
Post by Adam Sjøgren
I receive html-email generated by gmail using the «TeX for Gmail»
extension, which like latexit for thunderbird, or org-mime-htmlize for
Emacs converts latex formula to png.
mm-discouraged-alternatives
Set to nil
Post by Adam Sjøgren
mm-automatic-display
mm-automatic-display is a variable defined in ‘mm-decode.el’. Its value
is ("text/calendar" "text/plain" "text/enriched" "text/richtext"
"text/html" "text/x-verbatim" "text/x-vcard" "image/.*"
"message/delivery-status" "multipart/.*" "message/rfc822" "text/x-patch"
"text/dns" "application/pgp-signature" "application/emacs-lisp"
"application/x-emacs-lisp" "application/x-pkcs7-signature"
"application/pkcs7-signature" "application/x-pkcs7-mime"
"application/pkcs7-mime" "application/pgp\\'" "text/x-org")
Post by Adam Sjøgren
?
Have you tried using shr as the HTML renderer? I.e. leaving
mm-text-html-renderer at its default value?
Yes no difference
Post by Adam Sjøgren
Have you customized mm-automatic-display?
See above
Post by Adam Sjøgren
What have you set mm-inline-text-html-with-images to?
This is nil, custom tells me just to toggle them on
Post by Adam Sjøgren
And if you keep using w3m, what is mm-w3m-safe-url-regexp set to?
m-w3m-safe-url-regexp is a variable defined in ‘mm-decode.el’.
Its value is "\\`cid:"
Post by Adam Sjøgren
Those are the variables I have touched in my config; maybe one if the
holds the key.
Could you please send me your setting of this variable?

Thanks

Uwe
Adam Sjøgren
2015-09-12 12:54:16 UTC
Permalink
Post by Uwe Brauer
Post by Adam Sjøgren
What have you set mm-inline-text-html-with-images to?
This is nil, custom tells me just to toggle them on
So, isn't that the culprit?

,----[ C-h v mm-inline-text-html-with-images RET ]
| mm-inline-text-html-with-images is a variable defined in `mm-decode.el'.
| Its value is t
| Original value was nil
|
| Documentation:
| If non-nil, Gnus will allow retrieving images in HTML that has <img> tags.
| See also the documentation for the `mm-w3m-safe-url-regexp'
| variable.
`----

I would try setting that to t and use shr as the renderer.
Post by Uwe Brauer
Post by Adam Sjøgren
And if you keep using w3m, what is mm-w3m-safe-url-regexp set to?
m-w3m-safe-url-regexp is a variable defined in ‘mm-decode.el’.
Its value is "\\`cid:"
I've set it to nil (because I've also discouraged text/html display, and
thus actively have to choose to show HTML-parts).

,----[ C-h v mm-w3m-safe-url-regexp RET ]
| mm-w3m-safe-url-regexp is a variable defined in `mm-decode.el'.
| Its value is nil
| Original value was "\\`cid:"
|
| Documentation:
| Regexp matching URLs which are considered to be safe.
| Some HTML mails might contain a nasty trick used by spammers, using
| the <img> tag which is far more evil than the [Click Here!] button.
| It is most likely intended to check whether the ominous spam mail has
| reached your eyes or not, in which case the spammer knows for sure
| that your email address is valid. It is done by embedding an
| identifier string into a URL that you might automatically retrieve
| when displaying the image. The default value is "\\`cid:" which only
| matches parts embedded to the Multipart/Related type MIME contents and
| Gnus will never connect to the spammer's site arbitrarily. You may
| set this variable to nil if you consider all urls to be safe.
`----

Are the images in your emails inline or linked?
Post by Uwe Brauer
Post by Adam Sjøgren
Those are the variables I have touched in my config; maybe one if the
holds the key.
Could you please send me your setting of this variable?
We don't know that my setup shows the images, as you haven't provided
anything to test on.


Best regards,

Adam
--
"Halleluja og hurlumhej" Adam Sjøgren
***@koldfront.dk
Uwe Brauer
2015-09-12 13:06:18 UTC
Permalink
Post by Adam Sjøgren
We don't know that my setup shows the images, as you haven't provided
anything to test on.
Ok can I send you privately such an email and you tell me whether you
see the images?

I don't want to bother the list with html mail.

Uwe
Adam Sjøgren
2015-09-12 16:14:16 UTC
Permalink
Post by Uwe Brauer
Ok can I send you privately such an email and you tell me whether you
see the images?
Now that I have an example, I can see that your email contains links to
external images that need to be fetched by http. I wonder what you have
gnus-blocked-images set to?

If I set it to nil, Gnus/shr fetches the images from latex.codecogs.com
and displays them.

,----[ C-h v gnus-blocked-images RET ]
| gnus-blocked-images is a variable defined in `gnus-art.el'.
| Its value is nil
| Original value was
| gnus-block-private-groups
|
| Documentation:
| Images that have URLs matching this regexp will be blocked.
| This can also be a function to be evaluated. If so, it will be
| called with the group name as the parameter, and should return a
| regexp.
`----


Best regards,

Adam
--
"parsley, sage, rosemary and KOMPRESSOR" Adam Sjøgren
***@koldfront.dk
Uwe Brauer
2015-09-12 17:28:53 UTC
Permalink
Post by Adam Sjøgren
Post by Uwe Brauer
Ok can I send you privately such an email and you tell me whether you
see the images?
Now that I have an example, I can see that your email contains links to
external images that need to be fetched by http. I wonder what you have
gnus-blocked-images set to?
If I set it to nil, Gnus/shr fetches the images from latex.codecogs.com
and displays them.
That was the culprit!!! Thanks.

BTW the images are very big, also for your? I attach a screenshot


Thanks again, this has been very helpful.
Adam Sjøgren
2015-09-12 17:39:56 UTC
Permalink
Post by Uwe Brauer
BTW the images are very big, also for your? I attach a screenshot
I guess latex.codecogs.com sends big images? They look like that in my
Gnus as well.


Best regards,

Adam
--
"I'm a driver, I'm a winner, things are gonna change, Adam Sjøgren
I can feel it." ***@koldfront.dk
Uwe Brauer
2015-09-13 08:32:43 UTC
Permalink
Post by Adam Sjøgren
Post by Uwe Brauer
BTW the images are very big, also for your? I attach a screenshot
I guess latex.codecogs.com sends big images? They look like that in my
Gnus as well.
Ok, there seems nothing one can do about it, since the formulas look ok
in any browswer I tested: firefox/chrome/seamonkey.

BTW the formulas are not displayed, with the same setting, in Xemacs. I
will submit a bug report but don't make myself to many illusions (sigh
Xemacs...)
Adam Sjøgren
2015-09-13 11:45:35 UTC
Permalink
Post by Uwe Brauer
Post by Adam Sjøgren
I guess latex.codecogs.com sends big images? They look like that in my
Gnus as well.
Ok, there seems nothing one can do about it, since the formulas look ok
in any browswer I tested: firefox/chrome/seamonkey.
Not besides hacking Emacs to scale them.
Post by Uwe Brauer
BTW the formulas are not displayed, with the same setting, in Xemacs. I
will submit a bug report but don't make myself to many illusions (sigh
Xemacs...)
I gave up a couple of years ago.


Best regards,

Adam
--
"I'm a driver, I'm a winner, things are gonna change, Adam Sjøgren
I can feel it." ***@koldfront.dk
Uwe Brauer
2015-09-13 09:05:28 UTC
Permalink
Post by Adam Sjøgren
Post by Uwe Brauer
Ok can I send you privately such an email and you tell me whether you
see the images?
Now that I have an example, I can see that your email contains links to
external images that need to be fetched by http. I wonder what you have
gnus-blocked-images set to?
You are not going to believe that but the feature stopped working. With
the same setting as yesterday the images are not longer fetched.

(setq gnus-inhibit-mime-unbuttonizing nil)
(setq
mm-discouraged-alternatives nil
gnus-buttonized-mime-types '("multipart/signed" "multipart/encrypted")
; mm-automatic-display (remove "text/html" mm-automatic-display)
;; Render HTML with w3m
;;mm-text-html-renderer 'gnus-w3m
;;mm-text-html-renderer 'shr
mm-text-html-renderer 'gnus-article-html
mm-url-use-external t)

(setq w3m-safe-url-regexp nil)
(setq gnus-blocked-images nil)
(setq mm-inline-text-html-with-images t)



In xemacs they are fetched but not displayed.
Adam Sjøgren
2015-09-13 11:47:39 UTC
Permalink
Post by Uwe Brauer
You are not going to believe that but the feature stopped working. With
the same setting as yesterday the images are not longer fetched.
Well, then the webserver in the other end (latex.codecogs.com) returns:

HTTP/1.1 500 Internal Server Error.
Content-Type: text/html.
Content-Length: 369.
Date: Sun, 13 Sep 2015 11:43:58 GMT.
Server: lighttpd/1.4.36.
.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>500 - Internal Server Error</title>
</head>
<body>
<h1>500 - Internal Server Error</h1>
</body>
</html>

It _is_ kind of hard for Gnus to display the images.

That is the downside of relying on a third party to provide images.
Post by Uwe Brauer
In xemacs they are fetched but not displayed.
I don't know how you concluded that, but I doubt it.


Best regards,

Adam
--
"Everybody will be quick to agree that EMACS has a Adam Sjøgren
simple to learn user interface, at least to gain ***@koldfront.dk
'novice' status."
Uwe Brauer
2015-09-13 13:16:04 UTC
Permalink
Post by Adam Sjøgren
Post by Uwe Brauer
You are not going to believe that but the feature stopped working. With
the same setting as yesterday the images are not longer fetched.
HTTP/1.1 500 Internal Server Error.
Content-Type: text/html.
Content-Length: 369.
Date: Sun, 13 Sep 2015 11:43:58 GMT.
Server: lighttpd/1.4.36.
.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>500 - Internal Server Error</title>
</head>
<body>
<h1>500 - Internal Server Error</h1>
</body>
</html>
It _is_ kind of hard for Gnus to display the images.
How do you see this messages?
Post by Adam Sjøgren
That is the downside of relying on a third party to provide images.
But why are displayed in seamonkey/firefox/chrome correctly?
Post by Adam Sjøgren
Post by Uwe Brauer
In xemacs they are fetched but not displayed.
I don't know how you concluded that, but I doubt it.
Well I see

--8<---------------cut here---------------start------------->8---
Stored: Email from Uwe Brauer: To: UWE RICHARD OTTO Brauer: Date: Sun,
13 Sep 2015 11:16:58 +0200 Subj:
Retrieval complete.
Reading... 535 bytes.
Contacting latex.codecogs.com:80

tex Actually we have the following situation:
<pre_int>H_1\subse</pre_int><_id id="l0.06521869946887593"> are  Hilbert
spaces, a map <pre_int><img_alt
src="http://latex.codecogs.com/gif.latex?%5Cdpi%7B300%7D%5Cinline%09%5CPhi:H%5F1%5Cto%09H%5F1"
width="91" height="14" hseq="2" title="\Phi:H_1\to H_1">\Phi:H_1\to
H</img_alt></pre_int><_id id="l0.3265760676902906"> and we set
<pre_int><img_alt
src="http://latex.codecogs.com/gif.latex?%5Cdpi%7B300%7D%5Cinline%09x%5F{n%2B1}=%5CPhi(x%5Fn)"
width="98" height="16" hseq="3" yoffset="-1"
title="x_{n+1}=\Phi(x_n)">x_{n+1}=\Phi(x</img_alt></pre_int><_id
id="l0.17770456394407674">. Then by the energy estimates we have:

--8<---------------cut here---------------end--------------->8---

Thanks

Uwe
Adam Sjøgren
2015-09-13 13:34:42 UTC
Permalink
Post by Uwe Brauer
How do you see this messages?
I use ngrep(8) to watch the network traffic while displaying the HTML
email in Gnus.

You could use tcpdump(8), wireshark(1), or whatever your favourite
network monitoring tool is.
Post by Uwe Brauer
Post by Adam Sjøgren
That is the downside of relying on a third party to provide images.
But why are displayed in seamonkey/firefox/chrome correctly?
I don't know. "500 - Internal Server Error" is not very enlightening.
Try asking whomever runs latex.codecogs.com.

Oh, I just got a 500 Internal Server Error fetching one of the gifs in
Iceweasel, so I think latex.codecogs.com is just flaky:

* Loading Image...
Post by Uwe Brauer
Post by Adam Sjøgren
Post by Uwe Brauer
In xemacs they are fetched but not displayed.
I don't know how you concluded that, but I doubt it.
Well I see
Stored: Email from Uwe Brauer: To: UWE RICHARD OTTO Brauer: Date: Sun,
Retrieval complete.
Reading... 535 bytes.
Contacting latex.codecogs.com:80
And you are sure that 535 bytes is not the size of the Internal Server
Error response?


Best regards,

Adam
--
"Det er Thomas Treo, han kan _kun_ lide Sort Sol." Adam Sjøgren
***@koldfront.dk
Uwe Brauer
2015-09-13 13:26:22 UTC
Permalink
Post by Adam Sjøgren
Post by Uwe Brauer
You are not going to believe that but the feature stopped working. With
the same setting as yesterday the images are not longer fetched.
HTTP/1.1 500 Internal Server Error.
Content-Type: text/html.
Content-Length: 369.
Date: Sun, 13 Sep 2015 11:43:58 GMT.
Server: lighttpd/1.4.36.
.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>500 - Internal Server Error</title>
</head>
<body>
<h1>500 - Internal Server Error</h1>
</body>
</html>
It _is_ kind of hard for Gnus to display the images.
Now I found the following buffer _*mm-482677
who displays the information about the gifs (but Emacs does not display
them) so I conclude the server is right now not down?
Adam Sjøgren
2015-09-13 13:42:14 UTC
Permalink
Post by Uwe Brauer
Now I found the following buffer _*mm-482677
who displays the information about the gifs (but Emacs does not display
them) so I conclude the server is right now not down?
How do you get to that conclusion?

The mumbo-jumbo you cite is the HTML in the email - that says NOTHING
about whether latex.codecogs.com is working or not.

You have to follow the img-links to to see if you get an image or an
error page.

I get an error page in Iceweasel right now. A little earlier today I got
images.

So my conclusion is that there probably is a problem at
latex.codecogs.com and probably not in Emacs/Gnus.


Best regards,

Adam
--
"'What-you-see-is-what-you-get' is Motherhood and Adam Sjøgren
Apple Pie for screen editors, and EMACS definitely ***@koldfront.dk
succeeds here."
Adam Sjøgren
2015-09-13 13:46:58 UTC
Permalink
Post by Adam Sjøgren
So my conclusion is that there probably is a problem at
latex.codecogs.com and probably not in Emacs/Gnus.
Further evidence: If you go to http://latex.codecogs.com/ the image in
the example is broken currently.


Best regards,

Adam
--
"I think geniuses should be given special Adam Sjøgren
considerations." ***@koldfront.dk
Uwe Brauer
2015-09-14 17:28:09 UTC
Permalink
Post by Adam Sjøgren
Post by Adam Sjøgren
So my conclusion is that there probably is a problem at
latex.codecogs.com and probably not in Emacs/Gnus.
Further evidence: If you go to http://latex.codecogs.com/ the image in
the example is broken currently.
Right, this seems hopeless.
Post by Adam Sjøgren
Best regards,
Adam
Uwe Brauer
2015-09-12 12:53:12 UTC
Permalink
Post by Adam Sjøgren
Those are the variables I have touched in my config; maybe one if the
holds the key.
BTW what is your setting of
gnus-mime-display-multipart-related-as-mixed
gnus-mime-display-multipart-as-mixed
Loading...