Often my students want to look at my lecture notes on their phones. Obviously no one wants to do that routinely, but it is often convenient if you do not have a paper copy to hand and you just want to look up an isolated fact. I have A4 size pdfs on the web, which one can just about read on a phone, but it is quite awkward. Does anyone have a good set of options that they have tested for generating phone-readable pdfs from LaTeX?

UPDATE: In case anyone is interested, after following silex's suggestions I produced this: http://neil-strickland.staff.shef.ac.uk/courses/MAS201/MAS201_phone.pdf

-
With the geometry package you can set the "paper" size to be anything you want. –  Matthew Leingang Oct 24 '12 at 14:52
Hi Neil, Welcome to TeX.sx! From my experience, this will be a combination of fonts and page geometry (I have particular settings for my iPad and those involve both - if you think it helpful I can post those); the fonts will depend a bit on what you're already using and, in particular, if you're using pdf(la)tex or one of xe(la)tex or lua(la)tex. –  Loop Space Oct 24 '12 at 15:05
As smartphone and tablets can vary quite a bit in size maybe a reflowable format might be better than pdf. TeX4HT does quite a nice job, maybe that can complement pdf documents? –  Alexander Oct 24 '12 at 15:18

A4's are indeed quite large for normal reading. With the geometry package you can either specify the page size manually, or use a6paper which is readable on a phone. It's also a good idea to modify the margins, you don't need page numbers so they can be quite small. Another idea is to change the typeface to one more fit for screens.

Together all there options add up to this:

\documentclass[a6paper]{article}
\usepackage[margin=5mm]{geometry}
\usepackage{tgheros}
\usepackage[T1]{fontenc}
\renewcommand*\familydefault{\sfdefault}
\usepackage{lipsum} % Dummy Text
\begin{document}
\title{Lorem Ipsum}
\author{Dolor S. Amet}
\maketitle
\lipsum
\end{document}


Which looks like this on my phone (87x52mm or 2.06x3.43in):

This is still small, but a lot better than a4. The eyesight of your student is probably good enough to read this with ease from any reasonable distance. Either making the paper even smaller or increasing the font size can increase the readability of your text.

-
Thanks, I found that this worked pretty well, although I had to work through and break up a lot of displayed formulae by hand. –  Neil Strickland Oct 25 '12 at 10:23
I'm glad it worked pretty well, it's a pity that you had to break up formulae though. –  Silex Oct 26 '12 at 19:12

Further to the answer of Silex, I would like to add that in such cases the microtype package might come in handy. For example, the following result is obtained by simply loading microtype without any options:

-
I don't have enough reputation points to comment Silex's answer. Feel free to delete this post and add it as a comment to his answer (if you find it relevant). –  nnunes Oct 24 '12 at 15:35
No no, perfectly fine answer in my opinion (+1). –  morbusg Oct 24 '12 at 15:35

PDF isn't really a good format for reading on mobile devices, since they have varying screen sizes and PDF has completed fixed formatting. The best solution is probably to provide an e-book in EPUB format.

EPUB is designed for reflowable content, meaning that an EPUB reader can optimize text for a particular display device.

You can generate them from LaTeX files (or a huge variety of other files) with pandoc:

\$ pandoc -s source.tex -o output.epub


Pandoc is in most Linux repos, or you can get the package (for Windows, Mac or Linux) from the Pandoc website.

Then your students can read it with something like Aldiko (Android) or iBooks (iOS).

-
Technically, pandoc doesn't convert LaTeX files to EPUB. It can understand a very limited subset of LaTeX commands but wouldn't work on anything more complicated. –  Loop Space Oct 24 '12 at 22:27

Just tried it ...

These are the options for the geometry package that I ended up with. In effect I was varying the page size to get the right font size (since most PDF viewers will scale the page to fit the screen this is a cheap way to change font size).

  paperwidth=6cm,
paperheight=8cm,
width=5.5cm,
height=7.5cm,
left=.25cm,
includefoot,
foot=\baselineskip,


I find that on a small screen then I want both indentation and clear separation between paragraphs, thus:

\parskip=.8\baselineskip \advance\parskip by 0pt plus .2\baselineskip\relax


The document I'm testing on is a lualatex document so I can use the fontspec package to choose fonts. I chose a sans serif font from the TeX Gyre Package. Thus:

\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Heros}
\setmathfont{TG Pagella Math}


(Oddly, serif maths helps as the distinction between fonts makes it clearer when changing from text to maths and back again.)

A problem I run into is maths running into the margin and thus off the page. Commutative diagrams are ... unsalvageable.

Here's some sample pages.

-

Uwe Ziegenhagen published a (German) blog post on this topic: LaTeX Dokumente auf dem iPod und iPhone. (You'll be able to get the relevant bits and use the code even if you don't speak German.) He offers three increasingly sophisticated templates, optimized for iPhone screens at the time of publishing (Feb 2010). The third template includes links to get to the previous or next page and looks like this:

-
Hi doncherry, I just wanted to post a link to my article... You were faster! :-) –  Uwe Ziegenhagen Oct 31 '12 at 8:14

I like writing in Markdown but would like to convert Markdown to PDF. I use Pandoc for that. So I created a Pandoc LaTeX template that uses Uwe Ziegenhagen's template from the above answer in order to be able to create mobile size PDFs.

Here is the template as a gist, and the command used with Pandoc is:

pandoc document.md -o document.tex -s --template=iphone.latex


Then the .tex file can be converted to PDF using, for example, TeXworks.

The output isn't that nice though - if anyone that knows more about LaTeX would like to change the template to make it better I'll be really happy :)

Edit (December 2012): Just a small note on the improved potential for pdf on phones, Acrobat Reader has recently been greatly enhanced for Android playstore, and apparently for iPhone as well. Acrobat Reader for Mobile.

-
If you're already using Markdown and Pandoc, why not convert directly to EPUB instead of PDF? –  Brendan Long Oct 30 '12 at 14:49
Because, although I use ePUB, many people still don't know what it is. So I'd like to be able to publish both ePUB and mobile-size PDFs. –  yoavram Nov 1 '12 at 6:49