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.

Outbound link manager plugin is incompatible with QuickLatex

I found the rea­son for why some­times all Latex in my posts got clob­bered. The cul­prit was an out­dat­ed plu­g­in, which—as a side effect—deleted back­slash­es from posts. So I dein­stalled the sin­ner and also repaired all math that I found was bro­ken. If you still find bro­ken math, drop me a line.

\usepackage{cmbright}

The ‘mod­ern’ look­ing sans-serif font I use recent­ly in \text{\LaTeX} equa­tions on this blog is called ‘Com­put­er Mod­ern Bright’, and actu­al­ly is not so mod­ern at all: Designed by Wal­ter Schmidt in 1996, it is still to date the only free sans-serif font avail­able for \text{\LaTeX} with full math sup­port. Type‑1 ver­sions of this font are avail­able in the cm-super pack­age, but I did­n’t need to install any­thing, because appar­ent­ly, the Quick­La­TeX Word­Press plu­g­in has them already. The only thing to do was adding just one line to the preamble:

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{cmbright}   % computer modern bright

I also turned on the SVG images fea­ture that was added with ver­sion 3.8 of Quick­La­tex, so the equa­tions are no longer pixel­lat­ed on reti­na dis­plays or when zoom­ing in! Neat, huh?

Various Mac tricks

This is my per­son­al col­lec­tion of com­mand line tricks on Mac OS X that I found indis­pens­able. The list is far from com­plete, and may be added to in the future.

Show hidden files in Finder

> defaults write com.apple.finder AppleShowAllFiles true
> killall Finder

The first line sets the pref­er­ence for the Find­er to show hid­den files, while the sec­ond line restarts the Find­er so the set­ting comes in effect. As an alter­na­tive for the last line, select the Find­er in the Cmd-Alt-Escape pop­up and select “Relaunch”. I found this one on the Mozil­la knowl­edge base [2].

Delete all .DS_Store files

> sudo find / -name ".DS_Store" -print -delete

If hid­den files are enabled in the find­er, you will soon make con­tact with the infa­mous .DS_Store files that the desk­top ser­vice lit­ters around as you browse the filesys­tem. This is annoy­ing. Use the above com­mand to delete those suck­ers. The -print is in there just so you can mon­i­tor the progress.

Prevent .DS_Store files on network mounts

> defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Although there is no method to gen­er­al­ly stop .DS_Store files, at least you can pre­vent desk­top ser­vices from pol­lut­ing net­work mounts. Win­dows users on the same net­work will be glad! This trick is pub­lished in the Apple knowl­edge base [3].

Disable Spotlight indexing for a given volume

> sudo mdutil -i off /mountpoint

This com­mand will dis­able index­ing for the vol­ume under /mountpoint (for instance /Volumes/MyExternalHarddisk). Under MacOS X 10.5 and lat­er, it also deletes any par­tial index cre­at­ed up to this point. There is one caveat: The enable/disable infor­ma­tion is itself stored inside the .Spotlight-V100 direc­to­ry, so do not delete that, and be care­ful when back­ing up to anoth­er dri­ve. More infor­ma­tion is found in [1].


[1] The X‑Lab, “Spot­light tips”,
http://www.thexlab.com/faqs/stopspotlightindex.html

[2] Mozil­laZine, “Show hid­den files and folders”,
http://kb.mozillazine.org/Show_hidden_files_and_folders

[3] Apple Sup­port, “Mac OS X v10.4 and lat­er: How to pre­vent .DS_Store file cre­ation over net­work connections”,
http://web.archive.org/…