Style change – \usepackage{newtxmath}

This post is a quick annouce­ment that I changed the main text and math fonts and hope­ful­ly for the better.

Back­ground: This blog runs on Word­Press, using an almost vanil­la Twen­tyEleven theme and using the Quick­La­TeX plu­g­in for math type­set­ting. But while Word­Press uses a default sans-serif font (it explic­it­ly prefers Hel­veti­ca but also accepts any looka­like) the default font in \LaTeX is usu­al­ly Com­put­er Mod­ern, a com­plete­ly dif­fer­ence type­face. So with stan­dard set­tings, there was always going to be a font mis­match between text and math.

In order to mit­i­gate this, I pre­vi­ous­ly found Com­put­er Mod­ern Bright as an alter­na­tive \LaTeX font (see the old announce­ment post) that is a bet­ter match with Hel­veti­ca. CM Bright is one of the few sans-serif fonts in \LaTeX that has full math sup­port. But CM Bright also has issues, for exam­ple it is hard dis­tin­guish low­er­case l from upper­case I, and some of the gen­er­at­ed SVGs do not ren­der cor­rect­ly, espe­cial­ly if they are images of sin­gle letters.

Now I switched the main body text to Times, or what­ev­er the browser’s default serif font is. This is then com­bined with the newtx-pack­age on the \LaTeX-side, so now text and math use the same font (at least the­o­ret­i­cal­ly). See how this turns out for yourself:

a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

    \[\text{a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9}\]

The top row is text-mode (your browser’s ver­sion of Times or a sub­sti­tute), the bot­tom row is math-mode (a ren­dered SVG image by \LaTeX). In both cas­es, the request­ed font size is explic­it­ly 16 pix­els. It is expect­ed that the match is not per­fect, espe­cial­ly that the met­rics will be slight­ly dif­fer­ent, but over­all it should be an improve­ment. I am aware that com­mon wis­dom usu­al­ly says that serif fonts are bad for online view­ing, but has­n’t this advice become obso­lete with high-DPI dis­plays? And boy does the Times font look sharp and seri­ous! Every blog post now auto­mat­i­cal­ly looks like a paper.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.

Please answer the following anti-spam test

Which thing makes "tick-tock" and if it falls down, the clock is broken?

  1.    pencil
  2.    ruler
  3.    chair
  4.    table
  5.    watch