The Spectre of Math

July 18, 2013


Filed under: Uncategorized — jlebl @ 2:21 pm


See anything wrong here?



July 12, 2013

MAA reviews, HTML versions, new sections in RA book …

Filed under: LaTeX,Mathematics,Teaching — jlebl @ 7:54 pm


MAA has done reviews of both of my books: see here and here.  By the way, now they have been downloaded (at least the PDF) each from over 40k distinct addresses (approximately 83k together now).  Since it seems the web version of the diffyqs book is probably more popular than the PDF, there is probably another as many people who’ve used that.

HTML version of the DiffyQs book

Speaking of the HTML version.  After last release of the diffyqs book, I’ve worked a bit on the HTML conversion.  The result is using tex4ht for conversion and then a Perl script to clean up the HTML.  This is very very hacky, but of course the main point is to make it work rather than do it cleanly.  One of the things I’ve done was to render all math at double the resolution and let the browser scale it down.  Then to make things go a bit faster I’ve made the code detect duplicate images of which there are quite a few.  I’ve also been testing with data URIs for very small images, but they don’t quite work right everywhere yet.  They would cut down on the number of requests needed per page and surely eventually I’ll do that.

The supersampling has both positive and negative effects.  Printed version of the HTML now looks a lot better.  Not totally great since I currently have things render at around 200dpi rather than perhaps 300dpi, but it’s a reasonable compromise.  Also high resolution displays give nicer rendering.  The downside is that on a regular display the equations are fuzzier due to lack of hinting.

Of course MathJax would be the ultimate answer to the math display and that’s the ultimate goal, but I can’t make it work with tex4ht reasonably nice.  I am very picky about the display being 100% correct even if uglier, over being 90% correct and pretty.  Every suggestion I’ve tried so far was very subpar on output.  I can’t make tex4ht not touch all math.  Even then MathJax does choke on a few expressions I have in the file so things would require more tweaking to make it all work.

The requirements for math display I have is 1) I want to make sure that the same font is used on all math (that’s why I render all math as images).  2) I want the output to be correct and readable (which totally disqualifies MathML since even newest versions of all browsers do terrible jobs on all but the simplest equations, and even there).  3) I want the thing to be usable on as many browsers as possible.

I think eventually the solution would be to write my own tex parser that can read the subset of latex I use for the book and output HTML pages using MathJax.  This sounds simpler than it is.  That is, getting this to work on 90% of the input is easy, then things like figures, and certain math constructions get in the way.

Another possibility is to output svg instead of png for math using dvisvgm.  This keeps the problem of fuzziness on standard displays, but is really pretty when printed or on high resolution displays .  The downside is bad support (only very new chrome and firefox support this somewhat and even they have issues, and it crashes my android phone).  I think MathJax is a better long term solution, but it will take some work and probably a move away from tex4ht.

New sections in the analysis book

Something I have not mentioned here when it happened is that the analysis book got a bunch of new sections recently (the May 29th version).  These are all extra optional sections to fill up a longer version of the course (dependencies if any are marked in the notes at the beginning of each section).  There is a section on

  • Diagonalization argument and decimal representation of real numbers (1.5)
  • More topics on series (2.5)
  • Limits at infinity and infinite limits (3.5)
  • Monotone functions and continuity (3.6)
  • Inverse function theorem in one variable (4.4)
  • The log and exp functions (5.4)
  • Improper integrals (5.5)

I am currently working on multivariable chapter(s) that would come after chapter 7.  This will take some time still, I have about half of the material in a very rough draft, having massaged bits of my Math 522 notes into something that more fits this book.  My plan is for the book to be usable for a standard one year course on real analysis.

Create a free website or blog at