Generating iTeX bundles.

iTeX bundles are tar files of a directory laid out in a specific way. Since version 1.3, this layout format has been relaxed to simplify generation.

Basically, we place documents in a directory in a specific format, and use tar(1) to collect them up in a file. That tar file, given the extension ".itex", is the bundle accepted by the iTeX app.

Quick Start Guide

The minimum iTeX bundle contains just a single portrait PDF file and title and author information in a single directory:
	mkdir dir
	echo "Care and Nomenclature of the Anopheles Mosquito" >dir/Title
	echo "Flathead, Jules P." >dir/Author
	cp portrait.pdf dir
	(cd dir; tar cf - *) >flathead1.itex

Portrait.pdf is generated from the document source using pdflatex. Some sample boilerplate to get the formatting right for the iPad in portrait.tex:

\usepackage[screen, paperheight=7.60606060in,
%% because \pagestyle{empty} does not work on the first page:
% lucida bright is better for iPad-s low res 132 DPI. You probably don't have Lucida
% unless you bought it from TUG.
%% -- end of iTeX mods

%% itex \pagestyle{empty}	(remove pagestyle commands from your document)

\title{Care and Nomenclature of the Anopheles Mosquito}
\author{Flathead, Jules P.}


Make a copy of portrait.tex in landscape.tex, and start with:

\usepackage[screen, paperheight=5.6666666in,


For large type versions (also optional), use:

\usepackage[screen, paperheight=7.60606060in,


\usepackage[screen, paperheight=5.6666666in,


(Twelve point documents might be better.)

These quick-start bundles create a simplified iTeX bundle. The actual bundle format is slightly fancier and is described below. It should be used for real efforts to use iTeX, since planned features require it.


Below are the scripts used to generate LaTeX and iTeX bundles from Project Gutenberg and arXiv inputs. They are useful for automating the process.

Note: these scripts are crude and hacked up, brittle and unreliable. I welcome improvements and will gladly incorporate improvements.

Creating the versions for the iPad

There are two sample scripts. The first is run on a standard LaTeX document, and generates four LaTeX documents with a shot at appropriate settings for the iPad:

   latextoipad [-t title] [-a author] [master-dir|mydoc.tex]
You can specify the path to your LaTeX document, or to a directory (default is the current directory.) If a directory is given, latextoipad> will attempt to find the primary LaTeX file.

The program will attempt to extract the title and author from the document, or you can specify them explicitly.

Four LaTeX files are created:

 ipad-pn.tex portrait, normal font
 ipad-ln.tex landscape, normal font
 ipad-pl.tex portrait, large font
 ipad-ll.tex landscape, large font

These may be hand-edited, run through scripts, or hand generated without latextoipad. The are put in whatever directory was used, and are input for the next step. The author and title are also saved in files and used automatically by the second step, if present.

Creating iTeX bundle

genitex may be used to create the iTeX tar bundle, which uses the file extension .itex. Its input are the four (or two) files you generated above, and it writes an iTeX bundle to standard output. Sample use of both might be something like:

   latextoipad -a "William Cheswick" -t "Migratory Patterns of the Australian Frost Moth" moth.tex
   genitex ipad-pn.tex ipad-ln.tex ipad-pl.tex ipad-ll.tex >frost.itex
genitex also has the -a and -t parameters to specify author and title, if those aren't available on files from the previous step. It also has an -rl parameter that specifies that the document is to be presented right-to-left, perhaps for Chinese, Japanese, Hebrew, or Arabic documents.

Put frost.itex on a web page and download it to your iPad using Safari or the iTeX app.

Main scripts

These scripts are used to implement the itex translation server.

Auxilary tools

These scripts do some testing and analysis of iTeX bundles. They may be helpful in figuring out what is going on. These are all mostly quick hacks.