Friday, October 21, 2011

Making an e-reader compatible document in LaTeX

A few of my readers, I know, are LaTeX users, and of course, Google often directs people towards things which are useful. For that reason, I thought I'd post here the document code I use to create e-reader compatible .pdf files in LaTeX.
\documentclass[11pt,oneside,reqno]{amsart} \special{papersize=90mm,120mm} \usepackage[papersize={90mm,120mm},margin=2mm]{geometry}
A few notes:
  1. The option 11pt can be bumped up to 12pt if all your fonts can handle it. (I use the bbold font to get a nice blackboard bold 1; in turn, it screws up 12pt fonts. There doesn't seem to be a nice way to get everything I want…)
  2. Overfull boxes will be the bane of your life for a few reasons. Firstly, the margins are necessarily set extremely narrowly: overfill by about 6pt and you're off the screen. Secondly, if you're producing documents in dual format (A4 and e-reader, for example), then you will get the boxes right for at most one of the formats at any one time, unless you put pretty much all your equations into display mode.
  3. Generally speaking, .pdf documents cannot be scaled in e-readers, hence the need for a special setup. Until the ePub crowd get their mathematical act together, this is the best solution I have found.
  4. It is designed to fit a 6" screen, which sits nicely between the 5" and 7" which are about the smallest and largest on the market. The fact that it is also the size of my e-reader's screen is entirely beside the point.

No comments: