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.
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:
\documentclass[onecolumn,oneside]{book} \usepackage[screen, paperheight=7.60606060in, paperwidth=5.8181818in,left=1in,right=1in, top=1in,bottom=1in]{geometry} \pagestyle{empty} %% because \pagestyle{empty} does not work on the first page: \usepackage{fancyhdr} \fancypagestyle{plain}{% \fancyhf{}% \renewcommand{\headrulewidth}{0pt}% \renewcommand{\footrulewidth}{0pt}% } \batchmode % lucida bright is better for iPad-s low res 132 DPI. You probably don't have Lucida % unless you bought it from TUG. \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage{lucidabr} %% -- end of iTeX mods \begin{document} \sloppy \raggedbottom %% itex \pagestyle{empty} (remove pagestyle commands from your document) \title{Care and Nomenclature of the Anopheles Mosquito} \author{Flathead, Jules P.} \maketitle ...
Make a copy of portrait.tex in landscape.tex, and start with:
\documentclass[twocolumn,oneside]{book} \usepackage[screen, paperheight=5.6666666in, paperwidth=7.75757575in,left=7mm,right=7mm, top=7mm,bottom=5mm,twocolumn]{geometry} ...
For large type versions (also optional), use:
\documentclass[onecolumn,11pt,oneside]{book} \usepackage[screen, paperheight=7.60606060in, paperwidth=5.8181818in,left=1in,right=1in, top=1in,bottom=1in]{geometry} ...and
\documentclass[twocolumn,11pt,oneside]{book} \usepackage[screen, paperheight=5.6666666in, paperwidth=7.75757575in,left=7mm,right=7mm, top=7mm,bottom=5mm,twocolumn]{geometry} ...(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.
Note: these scripts are crude and hacked up, brittle and unreliable. I welcome improvements and will gladly incorporate improvements.
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.
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.itexgenitex 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.
These scripts are used to implement the itex translation server.
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.