Texpad on iOS includes an on-board typesetter capable of handling majority of your LaTeX documents.

## Local Typesetting

The local typesetter is built upon a Texpad's own LaTeX distribution that runs natively on your iPad, iPod or iPhone. This provides a fast Typesetting option that doesn't need an internet connection'. The local typesetter is also capable of typesetting BibTeX. If a BibTeX file is detected in your project, Texpad will automatically run it (in the sequence LaTeX, BibTeX, LaTeX, LaTeX).

Please note that the list of packages that comes bundled with Texpad for the use of the local typesetter is not as comprehensive as the full set of LaTeX packages that are part of a full desktop distribution such as TexLive or MikTeX. Adding all these packages to Texpad iOS not only would be unnecessary, but also result in a very large sized app. To address this issue, Texpad uses a LaTeX Bundle Manager (LBM) to deliver the extra packages. See the Settings section for more details.

## Cloud Typesetting

Cloud typesetting is done on Texpad's free cloud servers. The cloud typesetter packages your LaTeX source code and send it over a secure (HTTPS) connection to our servers where the files are typeset, and the PDF and the log are sent back to your device.

Once the typeset operation has completed, we delete user files off our servers immediately, regardless of the outcome of the typeset. The servers are secure, the files are transferred securely and we will never read or share your work. If this is not sufficient security for you then we are in the process of open sourcing the typesetting server so that you can typeset on your own secure server, please get in contact if you need this.

Cloud typesetting may be customised by using alternative typesetting chains via preferences. These include, XeLaTeX, pLaTeX (for Japanese) and tools for compiling through DVI and PostScript routes.

Only the files that are included in the outline view will be sent to the cloud typesetter, occasionally Texpad will not pick up every file you have included (for example if you have put the `\includegraphics` command inside a custom command. In this case you can force Texpad to include that file by adding a comment line (starting with a `%`) of the form `force-texpad-dependency: something.file` where you replace something.file with the necessary path name.

## How do I add packages to Texpad iOS?

Texpad automatically opens and typesets LaTeX packages (`.sty` and `.cls` files) that are placed in the current directory of a LaTeX document. Texpad iOS includes a repository of generic LaTeX packages that are managed by its LaTeX Bundle Manager which will allow users to install the full LaTeX distribution. Instead of installing the gigabytes of packages and fonts, users will be able to select just what they need from a list of bundles to suit their typesetting needs. Most users will however have packages that are shared by multiple documents. Texpad-Custom-Packages is the placeholder for such packages.

### The Texpad-Custom-Packages directory

Texpad iOS has the Texpad-Custom-Packages directory in the root of the iPad/iPod/iPhone storage.

Place a tex file here and it will be available to any file typeset with either Texpad's local or cloud typesetters. For those in the know, this is the iOS equivalent of texmf on the desktop.

Note that there is a BibTeX sub-directory there too for BibTeX style files and shared bibliographies.

### Adding files to the Texpad-Custom-Packages directory

You can create a file in the Texpad-Custom-Packages directly directly with Texpad as you would any other file, but there are two methods of adding existing files to that directory

- iTunes add these files to Texpad with iTunes (see Apple's guidelines for doing so for Apple apps: http://support.apple.com/kb/HT4094?v). This will place the file in the root folder of the iPhone storage, now to move it to the Texpad-Custom-Packages directory press Edit, select the file, press Copy and navigate to iPhone/Texpad-Custom-Packages and press the Copy the file into this folder button.

- Dropbox Add the files to Dropbox, then follow the same procedure to copy them into Texpad-Custom-Packages directory from within Texpad as described above for iTunes.

## Miscellaneous Notes on Typesetting in Texpad iOS

### Setting paper size with TeX

To set paper size with LaTeX it is necessary to set the paper size in both the document class and also in the geometry line. One of these changes the layout of the document to fit an a4 page, the other sends a message to the pdf generating toolchain to change the page size.

    \documentclass[a4paper]{article}
    \usepackage[a4paper]{geometry}
    \begin{document}
    Your document here
    \end{document}

### Typesetting EPS files with Texpad iOS

Due to the lack of a PostScript interpreter on iOS, Texpad iOS is currently unable to typeset eps figures with it's local typesetter. Texpad iOS is capable of typesetting eps figures in the cloud, and Desktop Texpad is capable of typesetting all figures, including EPS.

If you want to typeset vector graphics locally on your iOS device, then please export as a PDF rather than as an EPS. PDFs can be included the same as any other graphics file, using the graphicx package, and `\includegraphics{}`.

### Cloud typesetting failures with no log returned

Occasionally a cloud typeset job will get "stuck" in the cloud and fail to complete. In this case there is neither a TeX log, nor a pdf to return to the user.

Usually this happens because TeX hangs and doesn't return to the cloud typesetter. For the cases we have looked into, this seems to mainly occur with pdflatex, and switching engine to xelatex solves the problem.

NB Prior to 1.5 this would give a "http 0" error.

### bbm numerals with Texpad iOS's internal typesetter

The bbm package used to write double stroked numerals common in many mathematics and physics papers uses "bitmapped fonts", an old technology we have deprecated in Texpad's internal vvtex typesetting engine.

#### Why?

A bitmapped font specifies a character as an array of solid squares. These do not scale smoothly as you zoom, and they are not compatible with modern antialiasing techniques. Consequently, they do not display at the same high quality that TeX users are used to, and they have been deprecated both in and outside the TeX world in favour of vectored fonts, which look great at any size.

#### What is the replacement

These numerals can be rendered with high quality, modern vectored fonts via the dsfonts package. For example:

    \documentclass{article}
    \usepackage{dsfont}
    \begin{document}
      $\mathds{1}$
    \end{document}

### Typesetting languages

LaTeX Bundle Manager provides a means to download necessary packages to typeset documents in various languages supported in LaTeX.

#### What language bundles are supported?

Language bundles are listed in the alphabetically-sorted list in the bundle manager, accessed via the Settings' section in the main menu of Texpad for iOS. An excerpt of that table is shown below:

#### How do I install the bundle for my language?

You simply have to select the bundle for your language. For Spanish, you'll see

Press install and all the Spanish-related packages will be downloaded and installed on your device for Texpad to use for typesetting.