Posts Tagged ‘Latex’

Fixing a font problem for XeLaTeX

11 Oct 2013

If the topic sounds boring, well, it is really boring. I write it down here in case it’s useful to someone.

I was working on a talk about git & GitHub, and chose a different font (Helvetica Neue, sort of the default Apple font). I think the default font for LaTeX/Beamer is a bit too tall and thin for slides. Here’s the default:

Slide with default font

And here’s what I wanted:

Slide with Helvetica Neue

But it didn’t work on unix

It worked fine with XeLaTeX on my Mac, but it wasn’t working in Unix, and I’d like the source to be portable to others.

XeLaTex was giving two errors:

Invalid fontname `Helvetica Neue', contains ' '
Font \zf@basefont="Helvetica Neue" at 10.0pt not loadable: Metric (TFM) file
or installed font not found.

It obviously wasn’t finding the font.

I futzed about for an hour, trying to figure out where fonts are located on my Mac, and where fonts are located on Unix, and doing various web searches. But no luck.

How I solved the problem

Finally, I read this post on fonts in xelatex, and following that set of ideas, I figured out what to do.

  • Switch to the TeX Gyre Heros font. It looks just like Helvetica to me.
  • Download
  • On unix, unzip the file (which contains eight .otf files) into ~/.fonts
  • On Mac, unzip the file, double-click the .otf files and select “Install font.” This uses the Font Book application.
  • In the .tex file, use \setsansfont{TeX Gyre Heros}

Not thoroughly tested, but it works on two systems.

It was a really bad idea to use slides in that class

8 Oct 2013

I gave a presentation in the Statistical Consulting course at UW–Madison today. I’ve done so a number of times in the past 6 years. Until today, I’d just spoken informally from a few pages of notes. (Earlier this year, I wrote up those notes as a blog post.)

This year, just 45 min before the class, I thought I’d quickly create some slides to present. I thought it’d be an interesting “experiment” (not in the formal sense):

The outcome was pretty clear: It was easy to create a bunch of bullet-point-based slides. They look nice. (See the pdf here; source here.)

But, the slides themselves worse than useless: Unnecessary, and they interfered with the desired informal nature of the discussion.

I won’t be using those slides again. I’ll go back to just talking from notes.

Fortunately, the students were really good and involved and asked great questions, anyway. So no real harm done.

Better-looking LaTeX/Beamer slides

7 Oct 2013

I like to use LaTeX to make slides for talks, largely because I prefer to write code (rather than use a mouse and menus) for control of things like colors and figure placement.

Most people that use LaTeX to make slides seem to use Beamer, but the resulting slides are usually a bit busy, like this:

Typical beamer slide

I admire Till Tantau for creating Beamer; it was a great idea and it’s been widely adopted. But I don’t like talk outlines at all; I certainly don’t want to see one on every page.

After several days work, I’ve finally figured out how to create LaTeX/Beamer-based slides that look like what I want:

Open Access talk, title page

In this post, I’ll explain what I did.


LaTeX + Unicode → XeTeX

19 Mar 2013

I’m co-organizing a scientific meeting at the end of May. The abstracts are all in.

We get them in an Excel file, and I was working on a Perl script to parse the file to create a LaTeX file with the abstracts, so we could have nicely formatted versions for review. (I’m using Spreadsheet:XLSX for the first time; it’s really easy. Why have I always converted Excel files to CSV before parsing them?)

I spent way too much time trying to deal with special characters. I was looking to do a search-and-replace for all possible Unicode characters (for example, to change \xE9 aka é into \'{e}, or \xD7 aka × into $\times$).


But then I discovered that XeTeX supports Unicode, so there’s no need to do these sorts of substitutions.

I changed pdflatex to xelatex in my Makefile, and I’m done. I think.

Update: Now that I think about it, CSV is way more convenient than XLS(X) for simple data files, as you don’t have to traverse with the whole $cell -> (Val) business. But working with the Excel file directly is easier when the cells may contain lots of text with commas and such, like my abstracts.

My first fancy poster

16 Sep 2011

I’m preparing my first large-format poster (for the MathBio3 conference, here in Madison in two weeks). Previously, my posters had just been on a series of pieces of regular paper. (Consider, for example, this poster from September, 1998.) But no one does that anymore, and I don’t want to stand out as being archaic. That is, I want to pretend to be modern.

Here’s my draft: