The Feynman Lectures on Physics Online Edition

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

The Feynman Lectures on Physics Online Edition

Michael A. Gottlieb
Hello,

Michael Godfrey forwarded the following to me from this list, written by John S.:

This [online edition of The Feynman Lectures] does not render well in my browser. The MathJax numbers use a different font with a different weight compared to the surrounding text, which looks very bad.
...
MathJax looks bad in Google Chrome on OSX unless I right click and go choose Math Settings-Math Renderer and select SVG as the renderer. The HTML-CSS, Common HTML (which was the default), and Fast HTML all look really bad for me.

This concerns me because I am the editor of The Feynman Lectures on Physics (FLP) and the publisher of the online edition. I also find it surprising because I use Google Chrome on OSX and don't see any problems with the rendering of mathematics by MathJax in the online edition of FLP. 

That  VG rendering works right but HTML-CSS doesn't on your system suggests a font problem... but (if you haven't changed the MathJax defaults) any fonts missing from your OS should be downloaded automatically when they are needed.

I would like to help resolve this problem, if I can.

Mike Gottlieb
Reply | Threaded
Open this post in threaded view
|

Re: The Feynman Lectures on Physics Online Edition

Oliver Heimlich
On 12.01.2016 11:16, Michael A. Gottlieb wrote:

> Hello,
>
> Michael Godfrey forwarded the following to me from this list, written by
> John S.:
>
>
>     This [online edition of The Feynman Lectures] does not render well
>     in my browser. The MathJax numbers use a different font with a
>     different weight compared to the surrounding text, which looks very bad.
>     ...
>
>     MathJax looks bad in Google Chrome on OSX unless I right click and
>     go choose Math Settings-Math Renderer and select SVG as the
>     renderer. The HTML-CSS, Common HTML (which was the default), and
>     Fast HTML all look really bad for me.
>
>
> This concerns me because I am the editor of The Feynman Lectures on
> Physics (FLP) and the publisher of the online edition. I also find it
> surprising because I use Google Chrome on OSX and don't see any problems
> with the rendering of mathematics by MathJax in the online edition of FLP.
>
> That  VG rendering works right but HTML-CSS doesn't on your system
> suggests a font problem... but (if you haven't changed the MathJax
> defaults) any fonts missing from your OS should be downloaded
> automatically when they are needed.
>
> I would like to help resolve this problem, if I can.
>
> Mike Gottlieb
Well, “looking bad” is a bit harsh.  Most visitors don't have an eye for
these details and won't even notice.  Please look at the screenshots
attached to get an impression.  There seems to be a font problem on my
system.  I have disabled any adblockers and do not enforce particular
fonts in my browser.  Text zoom is at 100%.

There is a very short period of time during page load when the font
looks good.  But then MathJax changes fonts.

Looking at the DOM, I can see “font-size: 113%” for all MathJax frames.
 This seem to cause the too big fonts and also some bad extra margin to
the left.  Maybe you can disable this font-enlargement in MathJax.

Oliver

feynmanlectures-iceweasel-svg.png (12K) Download Attachment
feynmanlectures-iceweasel-htmlcss.png (11K) Download Attachment
feynmanlectures-iceweasel during page load.png (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Feynman Lectures on Physics Online Edition

John Swensen-3
In reply to this post by Michael A. Gottlieb

On Jan 12, 2016, at 2:16 AM, Michael A. Gottlieb <[hidden email]> wrote:

Hello,

Michael Godfrey forwarded the following to me from this list, written by John S.:

This [online edition of The Feynman Lectures] does not render well in my browser. The MathJax numbers use a different font with a different weight compared to the surrounding text, which looks very bad.
...
MathJax looks bad in Google Chrome on OSX unless I right click and go choose Math Settings-Math Renderer and select SVG as the renderer. The HTML-CSS, Common HTML (which was the default), and Fast HTML all look really bad for me.

This concerns me because I am the editor of The Feynman Lectures on Physics (FLP) and the publisher of the online edition. I also find it surprising because I use Google Chrome on OSX and don't see any problems with the rendering of mathematics by MathJax in the online edition of FLP. 

That  VG rendering works right but HTML-CSS doesn't on your system suggests a font problem... but (if you haven't changed the MathJax defaults) any fonts missing from your OS should be downloaded automatically when they are needed.

I would like to help resolve this problem, if I can.

Mike Gottlieb

I wasn’t talking about the FLP website looking bad. I was talking about going and using the Live Demo page from https://www.mathjax.org/ and I had to mess around with the setting of the MathJax output to set it to SVG output to get it to look “good”.

Here are some examples of the difference between HTML-CSS vs SVG. The other HTML options are even worse than HTML-CSS. You can see that a lot of the spacing and alignment just looks “off” for the HTML-CSS option, particularly when combining multiple marks above the letter. Below are a couple examples of the HTML-CSS output and then the SVG output.



On Jan 12, 2016, at 2:16 AM, Michael A. Gottlieb <[hidden email]> wrote:

Hello,

Michael Godfrey forwarded the following to me from this list, written by John S.:

This [online edition of The Feynman Lectures] does not render well in my browser. The MathJax numbers use a different font with a different weight compared to the surrounding text, which looks very bad.
...
MathJax looks bad in Google Chrome on OSX unless I right click and go choose Math Settings-Math Renderer and select SVG as the renderer. The HTML-CSS, Common HTML (which was the default), and Fast HTML all look really bad for me.

This concerns me because I am the editor of The Feynman Lectures on Physics (FLP) and the publisher of the online edition. I also find it surprising because I use Google Chrome on OSX and don't see any problems with the rendering of mathematics by MathJax in the online edition of FLP. 

That  VG rendering works right but HTML-CSS doesn't on your system suggests a font problem... but (if you haven't changed the MathJax defaults) any fonts missing from your OS should be downloaded automatically when they are needed.

I would like to help resolve this problem, if I can.

Mike Gottlieb

Reply | Threaded
Open this post in threaded view
|

Re: The Feynman Lectures on Physics Online Edition

Michael A. Gottlieb
In reply to this post by Oliver Heimlich
Well, “looking bad” is a bit harsh.  Most visitors don't have an eye for these details and won't even notice. 

I notice.

Please look at the screenshots attached to get an impression.  There seems to be a font problem on my system.  I have disabled any adblockers and do not enforce particular fonts in my browser.  Text zoom is at 100%.

Thanks for the screenshots. I've attached my own, showing the same text and math, framed the same way as in your shots. These were made using Google Chrome 47.0.2526.106 (64-bit) under Mac OSX 10.11.2 running on a MacBook Pro - all 'vanilla' (no customization). 
 
There is a very short period of time during page load when the font looks good.  But then MathJax changes fonts.

What you see initially, during that "short time," is a 'fast preview' put up by MathJax while it completes its typesetting. It isn't very accurately typeset and doesn't include equation numbers. 

Looking at the DOM, I can see “font-size: 113%” for all MathJax frames. This seem to cause the too big fonts and also some bad extra margin to the left.  Maybe you can disable this font-enlargement in MathJax.

MathJax is not the problem. 

The problem is apparent from your screenshots: the body text isn't being displayed in the right font. It should be Georgia, serif, which is a heavier font than what your browser is displaying, and a good match to the font MathJax is using.

HTML-CSS.png (23K) Download Attachment
SVG.png (24K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Feynman Lectures on Physics Online Edition

Oliver Heimlich
In reply to this post by Oliver Heimlich
On 12.01.2016 18:59, Oliver Heimlich wrote:

> On 12.01.2016 11:16, Michael A. Gottlieb wrote:
>> Hello,
>>
>> Michael Godfrey forwarded the following to me from this list, written by
>> John S.:
>>
>>
>>     This [online edition of The Feynman Lectures] does not render well
>>     in my browser. The MathJax numbers use a different font with a
>>     different weight compared to the surrounding text, which looks very bad.
>>     ...
>>
>>     MathJax looks bad in Google Chrome on OSX unless I right click and
>>     go choose Math Settings-Math Renderer and select SVG as the
>>     renderer. The HTML-CSS, Common HTML (which was the default), and
>>     Fast HTML all look really bad for me.
>>
>>
>> This concerns me because I am the editor of The Feynman Lectures on
>> Physics (FLP) and the publisher of the online edition. I also find it
>> surprising because I use Google Chrome on OSX and don't see any problems
>> with the rendering of mathematics by MathJax in the online edition of FLP.
>>
>> That  VG rendering works right but HTML-CSS doesn't on your system
>> suggests a font problem... but (if you haven't changed the MathJax
>> defaults) any fonts missing from your OS should be downloaded
>> automatically when they are needed.
>>
>> I would like to help resolve this problem, if I can.
>>
>> Mike Gottlieb
>
> Well, “looking bad” is a bit harsh.  Most visitors don't have an eye for
> these details and won't even notice.  Please look at the screenshots
> attached to get an impression.  There seems to be a font problem on my
> system.  I have disabled any adblockers and do not enforce particular
> fonts in my browser.  Text zoom is at 100%.
>
> There is a very short period of time during page load when the font
> looks good.  But then MathJax changes fonts.
>
> Looking at the DOM, I can see “font-size: 113%” for all MathJax frames.
>  This seem to cause the too big fonts and also some bad extra margin to
> the left.  Maybe you can disable this font-enlargement in MathJax.
>
> Oliver
>

Hi Michael,

I could find the cause for the ugly increased font-size on my system by
playing around with MathJax (see [1]). It is caused by the
“matchFontHeight” option, which is enabled by default. It does a bad job
on my system and increases the font size (don't know why).

When I disable this in MathJax, the FLP math looks good to me.

Best
Oliver


[1]
http://octave.1599824.n4.nabble.com/Latex-equation-support-in-the-documentation-created-by-generate-html-package-td4677129.html

Reply | Threaded
Open this post in threaded view
|

Re: The Feynman Lectures on Physics Online Edition

Michael A. Gottlieb
Dear Oliver,

Thanks very much for this information.  Now that I better understand the nature of your complaint I see you are absolutely correct: MathJax's "matchFontHeight" option should be renamed "DontMatchFontHeight" ! In my (Mac Chrome) browser it's rendering the math 11% bigger than the body text. I've gotten so used to looking at it that way that I didn't notice it was too big! This is not particularly good from an aesthetic POV, and it also makes the online edition somewhat less readable on small devices. To demonstrate this to my colleagues I've generated an alternate version of FLP chapter I:19 which can be compared to the current version.  I will run "matchFontHeight: false" up the flagpole and see who salutes.

Thanks again for your help.

Best regards,
Mike

On Mon, May 30, 2016 at 7:33 AM, Oliver Heimlich <[hidden email]> wrote:
On 12.01.2016 18:59, Oliver Heimlich wrote:
> On 12.01.2016 11:16, Michael A. Gottlieb wrote:
>> Hello,
>>
>> Michael Godfrey forwarded the following to me from this list, written by
>> John S.:
>>
>>
>>     This [online edition of The Feynman Lectures] does not render well
>>     in my browser. The MathJax numbers use a different font with a
>>     different weight compared to the surrounding text, which looks very bad.
>>     ...
>>
>>     MathJax looks bad in Google Chrome on OSX unless I right click and
>>     go choose Math Settings-Math Renderer and select SVG as the
>>     renderer. The HTML-CSS, Common HTML (which was the default), and
>>     Fast HTML all look really bad for me.
>>
>>
>> This concerns me because I am the editor of The Feynman Lectures on
>> Physics (FLP) and the publisher of the online edition. I also find it
>> surprising because I use Google Chrome on OSX and don't see any problems
>> with the rendering of mathematics by MathJax in the online edition of FLP.
>>
>> That  VG rendering works right but HTML-CSS doesn't on your system
>> suggests a font problem... but (if you haven't changed the MathJax
>> defaults) any fonts missing from your OS should be downloaded
>> automatically when they are needed.
>>
>> I would like to help resolve this problem, if I can.
>>
>> Mike Gottlieb
>
> Well, “looking bad” is a bit harsh.  Most visitors don't have an eye for
> these details and won't even notice.  Please look at the screenshots
> attached to get an impression.  There seems to be a font problem on my
> system.  I have disabled any adblockers and do not enforce particular
> fonts in my browser.  Text zoom is at 100%.
>
> There is a very short period of time during page load when the font
> looks good.  But then MathJax changes fonts.
>
> Looking at the DOM, I can see “font-size: 113%” for all MathJax frames.
>  This seem to cause the too big fonts and also some bad extra margin to
> the left.  Maybe you can disable this font-enlargement in MathJax.
>
> Oliver
>

Hi Michael,

I could find the cause for the ugly increased font-size on my system by
playing around with MathJax (see [1]). It is caused by the
“matchFontHeight” option, which is enabled by default. It does a bad job
on my system and increases the font size (don't know why).

When I disable this in MathJax, the FLP math looks good to me.

Best
Oliver


[1]
http://octave.1599824.n4.nabble.com/Latex-equation-support-in-the-documentation-created-by-generate-html-package-td4677129.html

Reply | Threaded
Open this post in threaded view
|

Re: The Feynman Lectures on Physics Online Edition

Michael A. Gottlieb
Dear Oliver,

Here are the results of yesterday's survey:

Most of my colleagues prefer "matchFontHeight: false" in the online edition of FLP, However some prefer "matchFontHeight: true," which increases the math font size by 11%, making it bigger than the body text, and that does not look very good, as you have noted. However, I made some careful measurements and discovered that "matchFontHeight: false" leaves the mathematics somewhat smaller than our (Georgia font) body text, which also does not look very good. So, what I've done is this: In the "HTML-CSS" section of Mathjax.Hub.Config I set  "matchFontHeight: false" but also "scale: 106" which increases the math font size by 6%. This gives a good match to our body text. I also edited "styles" to make the top and bottom margin around display equations 15% smaller (reducing them from 1em to .85em). And finally, in the "Tex" section of Mathjax.Hub.Config I changed TagIndent to 0.25em; previously it was set to 0em, which allowed the equation numbers to crowd wider equations on narrower displays.

I consider the overall improvement to be considerable, so thanks once again for bringing matchFontHeight to my attention.

Best regards,
Mike 

On Mon, May 30, 2016 at 9:13 AM, Michael A. Gottlieb <[hidden email]> wrote:
Dear Oliver,

Thanks very much for this information.  Now that I better understand the nature of your complaint I see you are absolutely correct: MathJax's "matchFontHeight" option should be renamed "DontMatchFontHeight" ! In my (Mac Chrome) browser it's rendering the math 11% bigger than the body text. I've gotten so used to looking at it that way that I didn't notice it was too big! This is not particularly good from an aesthetic POV, and it also makes the online edition somewhat less readable on small devices. To demonstrate this to my colleagues I've generated an alternate version of FLP chapter I:19 which can be compared to the current version.  I will run "matchFontHeight: false" up the flagpole and see who salutes.

Thanks again for your help.

Best regards,
Mike

On Mon, May 30, 2016 at 7:33 AM, Oliver Heimlich <[hidden email]> wrote:
On 12.01.2016 18:59, Oliver Heimlich wrote:
> On 12.01.2016 11:16, Michael A. Gottlieb wrote:
>> Hello,
>>
>> Michael Godfrey forwarded the following to me from this list, written by
>> John S.:
>>
>>
>>     This [online edition of The Feynman Lectures] does not render well
>>     in my browser. The MathJax numbers use a different font with a
>>     different weight compared to the surrounding text, which looks very bad.
>>     ...
>>
>>     MathJax looks bad in Google Chrome on OSX unless I right click and
>>     go choose Math Settings-Math Renderer and select SVG as the
>>     renderer. The HTML-CSS, Common HTML (which was the default), and
>>     Fast HTML all look really bad for me.
>>
>>
>> This concerns me because I am the editor of The Feynman Lectures on
>> Physics (FLP) and the publisher of the online edition. I also find it
>> surprising because I use Google Chrome on OSX and don't see any problems
>> with the rendering of mathematics by MathJax in the online edition of FLP.
>>
>> That  VG rendering works right but HTML-CSS doesn't on your system
>> suggests a font problem... but (if you haven't changed the MathJax
>> defaults) any fonts missing from your OS should be downloaded
>> automatically when they are needed.
>>
>> I would like to help resolve this problem, if I can.
>>
>> Mike Gottlieb
>
> Well, “looking bad” is a bit harsh.  Most visitors don't have an eye for
> these details and won't even notice.  Please look at the screenshots
> attached to get an impression.  There seems to be a font problem on my
> system.  I have disabled any adblockers and do not enforce particular
> fonts in my browser.  Text zoom is at 100%.
>
> There is a very short period of time during page load when the font
> looks good.  But then MathJax changes fonts.
>
> Looking at the DOM, I can see “font-size: 113%” for all MathJax frames.
>  This seem to cause the too big fonts and also some bad extra margin to
> the left.  Maybe you can disable this font-enlargement in MathJax.
>
> Oliver
>

Hi Michael,

I could find the cause for the ugly increased font-size on my system by
playing around with MathJax (see [1]). It is caused by the
“matchFontHeight” option, which is enabled by default. It does a bad job
on my system and increases the font size (don't know why).

When I disable this in MathJax, the FLP math looks good to me.

Best
Oliver


[1]
http://octave.1599824.n4.nabble.com/Latex-equation-support-in-the-documentation-created-by-generate-html-package-td4677129.html


Reply | Threaded
Open this post in threaded view
|

Re: The Feynman Lectures on Physics Online Edition

Oliver Heimlich
On 31.05.2016 14:44, Michael A. Gottlieb wrote:

> Dear Oliver,
>
> Here are the results of yesterday's survey:
>
> Most of my colleagues prefer "matchFontHeight: false" in the online
> edition of FLP <http://www.feynmanlectures.caltech.edu>, However some
> prefer "matchFontHeight: true," which increases the math font size by
> 11%, making it bigger than the body text, and that does not look very
> good, as you have noted. However, I made some careful measurements and
> discovered that "matchFontHeight: false" leaves the mathematics
> somewhat /smaller/ than our (Georgia font) body text, which also does
> not look very good. So, what I've done is this: In the "HTML-CSS"
> section of Mathjax.Hub.Config I set  "matchFontHeight: false" but also
> "scale: 106" which increases the math font size by 6%. This gives a good
> match to our body text. I also edited "styles" to make the top and
> bottom margin around display equations 15% smaller (reducing them from
> 1em to .85em). And finally, in the "Tex" section of Mathjax.Hub.Config I
> changed TagIndent to 0.25em; previously it was set to 0em, which allowed
> the equation numbers to crowd wider equations on narrower displays.
>
> I consider the overall improvement to be considerable, so thanks once
> again for bringing matchFontHeight to my attention.
>
> Best regards,
> Mike

Dear Mike,

sigh … the problem of incompatible font metrics.

I always try to use the same font (family and size) for maths as for
surrounding text. I also do this in LaTeX/PDF documents whenever
possible. IMHO, having a different font for mathematics is an ancient
legacy that predates Unicode and Unicode fonts and which I don't find
aesthetic. Unfortunately, it is still common to use different fonts and
it's the default in LaTeX. For example, it was a lot of work to achieve
something else with LaTeX for my thesis [1] (and if you look carefully,
the italic variables are of a different font, because I wasn't able to
typeset them in the desired font).

Maybe you have a printed copy of “Chicago Manual of Style” (16th
Edition) in your library. Look at Chapter 12 how nicely the math
examples integrate in the surrounding text when everything uses the same
font.

For web pages I find this even more important. Most/all of the MathJax
fonts are not well suited for low definition screens, which are still
very common.

See [2] for what I tried with MathJax to use the surrounding font in
math. However, the calculated margins of MathJax are obviously based on
different font metrics and some of the alignment is recognizably wrong
when I change fonts with CSS. This is solved way better by the MathML
rendering in Gecko. However, in Gecko's MathML engine I don't know how
to modify the font of italic characters. :-/

To be honest, I don't want to do all that fine-tuning to get a (IMHO)
somewhat acceptable result with MathJax. Did you file a bug report
regarding the Don'tMatchFontHeight feature?

Best regards
Oliver

[1] http://exp.ln0.de/heimlich-power-2011.pdf
[2]
http://lists.gnu.org/archive/html/octave-maintainers/2016-05/msg00403.html

Reply | Threaded
Open this post in threaded view
|

Re: The Feynman Lectures on Physics Online Edition

Michael A. Gottlieb
Hi, Oliver.

sigh … the problem of incompatible font metrics.

I always try to use the same font (family and size) for maths as for
surrounding text. I also do this in LaTeX/PDF documents whenever
possible. IMHO, having a different font for mathematics is an ancient
legacy that predates Unicode and Unicode fonts and which I don't find
aesthetic.

The Feynman Lectures on Physics (FLP) was published in 1963-65, so it certainly predates Unicode fonts! The printed books have always used different fonts for mathematics and for body text. In figures they use yet other fonts for math and text. Another font is used for chapter titles and numbers, another font is used for the tables of contents. There are yet other fonts used on the title pages. Yet, in my opinion, FLP is a beautifully set book. It's a classic who's look and feel we wanted to preserve as much as possible. Rudi Pfeiffer, who created the LaTeX manuscript, took great pains to make this so -- even the page breaks fall in the same places as the original (despite changes of content)! 

I disagree with your notion that only one font should be used in a document (such as a book). Different fonts are useful for different things. Typography and bookmakings are arts that should not be overly restricted with arbitrary rules, and using only one font in a book is very restrictive, in my opinion.

The online edition of FLP, which was derived from the LaTeX manuscript, is designed to look as much as possible like the printed books, and I think that within the limitations of common browser support it does a pretty good job of doing that, though by no means perfect: the books are better set. A lot of people have complimented the looks of the online edition of FLP.  And your observations and comments have made it look even better, for which I am very grateful.

For web pages I find this even more important. Most/all of the MathJax
fonts are not well suited for low definition screens, which are still
very common.

I'm not sure if this is an issue for us. At least no one has complained about the MathJax renderings being unreadable. If you will please define (with some metrics) what you mean by "low definition screens" I can tell you exactly how many of our 2.2 million readers (to date) used them. (We use Google Analytics to track such information.)

See [2] for what I tried with MathJax to use the surrounding font in
math. However, the calculated margins of MathJax are obviously based on
different font metrics and some of the alignment is recognizably wrong
when I change fonts with CSS.

Just for fun I recreated your experiment on a page of the online edition of FLP. It looked terrible, as promised. ;->
 
Did you file a bug report regarding the Don'tMatchFontHeight feature?

No, but I found another bug yesterday, in the latest release of Chrome, which I did report (after figuring out a workaround... or so I thought. Today I find the bug still occurs on some of our pages).

Best regards,
Mike