Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

exporting as html from thunderbird

  • 17 replies
  • 1 has this problem
  • 59 views
  • Last reply by rayandrews

Hi,

I have a huge document that took months to write. I wrote it in Thunderbird. I can save it as HTML and Firefox views it fine, however no other program can view it properly. w3.org reports it to be riddled with errors. Libreoffice can't open it at all. In particular it is full of Insert > Math code that nothing but TB and Firefox can format properly. Is there some way to salvage the situation? Can I convert it to legal HTML? As it is now, all I can do is print it off and mail it.

Hi, I have a huge document that took months to write. I wrote it in Thunderbird. I can save it as HTML and Firefox views it fine, however no other program can view it properly. w3.org reports it to be riddled with errors. Libreoffice can't open it at all. In particular it is full of Insert > Math code that nothing but TB and Firefox can format properly. Is there some way to salvage the situation? Can I convert it to legal HTML? As it is now, all I can do is print it off and mail it.

Chosen solution

Yeah, I doubt rendering pdfs is among LibreOffice's strong suits. A proper pdf reader should work just fine though and sharing in pdf format is the best you could do in matters . I have a hard time imagining anyone having challenges reading a pdf today, visual impairment aside.

Read this answer in context 👍 1

All Replies (17)

How did you write the document? Did you by any chance use some add-on for html editing or just Thunderbird's native composer? What do those insert statements coincide with in your document?

Stans, thanks for the help. I just composed the doc in TB with nothing external involved. Here's a paste of a sample of literal code:


Eg: <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics> <mrow><mi>l</mi><mi>o</mi><msub><mi>g</mi><mn>5</mn> </msub><mo stretchy="false">(</mo><mn>125</mn> <mo stretchy="false">)</mo><mo>=</mo><mn>3</mn><mo>=</mo><mfrac><mn>1</mn><mfrac><mn>1</mn><mn>3</mn></mfrac></mfrac></mrow><annotation encoding="TeX">log_5(125)=3=\frac{1}{\frac{1}{3}}</annotation></semantics></math>

The included image is a screencap of what it looks like in either TB or Firefox, but Libreoffice can't render it, nor can anyone I've emailed it to see it as anything but code. Chromium doesn't like it. 'Texmaker' does render it without complaint and w3.org, tho it finds my full document riddled with errors (mostly it wants CSS instead of '<font>'), does not complain about the code above. I hate to suggest that the people I want to send this too must have Firefox or TB! </font>

... needless to say, most of the people I want to send my doc to are Micro-serfs, so that won't be helping.

That is MathML code and you should know the status of MathML support in Chromium (see https://mathml.igalia.com) and its derivatives, Webkit and Gecko-based browsers like Firefox (and Thunderbird) etc. If all you want is a consistent presentation of the document to various recipients, your best bet is to save/print it as pdf and email it. You'll have to look into MathML support in each of those applications you're using to open the document. If it ain't rendering the code as expected, then it's not supported. It shouldn't be a problem to recommend Firefox for opening the document.

Alternatively, convert the MathML code into Mathjax. See https://www.mathjax.org/

Modified by Stans

Thanks! This is just the sort of real brass-tacks knowledge I need to hear. Yeah, I've already realized that MathML is at the bottom of this, so, as you say, it's a question of some more universal format. I had thought that it all ends up as latex. To be honest I'd feel a bit embarrassed telling people they have to install Firefox or TB to view it. I've tried .pdf export, but libreoffice doesn't show the math correctly -- mind, that might be libreoffice's fault. Anyway, I'm on the scent.

Chosen Solution

Yeah, I doubt rendering pdfs is among LibreOffice's strong suits. A proper pdf reader should work just fine though and sharing in pdf format is the best you could do in matters . I have a hard time imagining anyone having challenges reading a pdf today, visual impairment aside.

I've never even tried to edit a pdf before now, so there's another learning curve. Can you suggest some better editor? I'm pretty basic, I like the 'dumb' plain editors like Geany, I'm a text sort of person. But if I hafta learn pdf then I'll take your advice as to what to use. The good thing about Linux is the amount of choice. The bad thing about Linux is the amount of choice, you just don't know what to pick. Anyway, the good news is that TB export to .pdf seems exportable to windows users, so that's the crux of the matter.

Thanks Stans, you're help that actually helps. I'm going to keep this tab open just in case I need to bug you about something else.

On no, I'm afraid you misunderstand. I wasn't suggesting you work with a pdf editor to recreate the document. I was suggesting you keep the document in Thunderbird then print it to pdf for sharing, of course assuming you've done all that needs to be done regarding writing the document. Printing to pdf and sharing as such instead of html should spare you the trouble of having to rewrite the document while solving the issue of presentation to the recipients.

If you later on feel like recreating the document, I highly recommend using a LaTex implementation and a suitable GUI editor/frontend such as LyX, or LibreOffice with the TexMaths extension if this is what you're accustomed to. Once you're done recreating the document, export or print to pdf for sharing. I avoid using a pdf editor for document processing despite having access to Acrobat Pro. I prefer working with any other document processor to the end, and only then, do I produce a pdf for electronic sharing.

It sounds like you're printing/saving the document to pdf/html from Thunderbird, then opening/importing the pdf/html in LibreOffice for editing. If that's how you're doing it, may I suggest you copy-paste chunks of text into LibreOffice from Thunderbird and recreate the formulas/equations using that LaTex extension as you progress, then finish up with formatting to your liking. It may end up being a day's work, but it'll be well worth it instead of using Thunderbird as a document processor.

> I wasn't suggesting you work with a pdf editor to recreate the document.

Ah. I thought there might be some dedicated editor, which would be nice. Anyway, MathJax seems to work like a charm. I can keep, nice, easy to edit HTML, add this:

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

... as MathJax suggests and everything works auto-magically! Or at least Chromium now sees it correctly.

I might one day learn to edit .pdf but right out of the box it seems like a hellish learning curve.

Funny thing tho, the above script fixes it for chromium, but very slightly breaks it for firefox -- it isn't exactly 'wrong' but it looks lousy.

Specimen of bad formatting below:

Thanks Stans, but that doc overwhelms me. When I search the web for 'mathml' I get all sorts of info on the html codes when, for now, all I want to do is find out what's available in the 'Input > Math' window, stuff like this:

log_b(x)=\frac{1}{log_x(b)}

Where can I find a manual on ... whatever that is? I don't even know what to call it Tex, Latex, mathml, what *is* that script? Is it documented somewhere? I was innocently trying to write several lines of equations with one call. Supposedly '\\' indicates a newline, but it doesn't work. For now I want to just trust TB's math input script but can't find any doc to help me.

rayandrews said

Funny thing tho, the above script fixes it for chromium, but very slightly breaks it for firefox -- it isn't exactly 'wrong' but it looks lousy. ... Specimen of bad formatting below:

Yes, this is the nightmare that you have to deal with when working with non-standardized technologies, which is why I recommend sharing the document as a pdf instead of html. With pdf, you get a universal look when the document is rendered, but with html, there is no telling how the recipient's side of things will look like. The only reason you should be sharing as html is if the recipient needs to access to source code for whatever reason. I recreated your math formular via a text editor using mathml code only and used the following script:

<script src="https://fred-wang.github.io/mathml-warning.js/mpadded-min.js"></script>

as featured in the "overwhelming" doc I linked to. Attached are screenshots of how it's rendered by different renderers. This is the first mathml code I've ever written and it took me around six hours of going through the reference here! So, I am far from a guru in Mathml and do not wish to become one here. It is way beyond the scope of this forum, of which we've already ventured out of. What I can do, however, is share links to relevant resources that might help.

rayandrews said

all I want to do is find out what's available in the 'Input > Math' window, stuff like this: log_b(x)=\frac{1}{log_x(b)} Where can I find a manual on ... whatever that is? I don't even know what to call it Tex, Latex, mathml, what *is* that script? Is it documented somewhere? I was innocently trying to write several lines of equations with one call. Supposedly '\\' indicates a newline, but it doesn't work. For now I want to just trust TB's math input script but can't find any doc to help me.

I don't know if there is a manual or documentation for Thunderbird's Math Formula input, but there is really no need for one because it's basically a Latex to Mathml converter, so what you should be looking for, is Latex documentation such as https://www.latex-project.org/help/documentation/

When you're done creating your formulas, I recommend using one of those polyfill scripts (Mathjax works great on my end as per those screenshots) and Chrome/Chromium, since they do a great job compared to Firefox's native renderer, to render the document and export to pdf for sharing.

> but there is really no need for one because it's basically a Latex to Mathml converter

Just that simple remark is vastly helpful. Now I know what I'm looking for. It's that 'overview' level that I need. Ok, so mathml is HTML code as I see it in the doc. Latex is the input language that creates mathml. And TB has some more or less functional implementation of latex. It helps when one knows what one is talking about -- literally. And if my latex can't do it, I can always edit the mathml.

rayandrews said

> And TB has some more or less functional implementation of latex.

Yes, that Insert Mathematical Formula dialog box is TB's implementation of a LaTex WYSIWYG editor (and converter into HTML/mathml) and as you can clearly see, it says Enter LaTex source code. It should serve the purpose just fine, but you can always edit the html/mathml as needed. You could even try other LaTex to HTML/mathml/javascript editors and/or converters and insert the resultant html into Tbird or directly into the html document to see what works best. I'm not sure how mature TB's implementation is since it was added a long time ago, but this shouldn't be a hinderance since there are alternative tools you could use.

> and as you can clearly see, it says Enter LaTex source code

Sure, and one of the things that threw me off the scent was that the " \\ " newline command doesn't work. Now that I know what mathml IS and what LaTex IS, things become more clear. And I've learned that none of this is perfect, which is why "<mspace linebreak = 'newline'/>" is supposed to work, but doesn't work in TB or FF, but does work in Chromium.

BTW,

<script src="https://fred-wang.github.io/mathml-warning.js/mpadded-min.js"></script>

Looks good in both FF and Chromium whereas:

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

Looks good in Chromium but poor in FF. Anyway, thanks to you I begin to have some idea what's going on. As you say, .pdf seems to be universal.