[Fix #484] Set OS X specific latex settings conditionally
Pull in upstream changes