Texpad is a LaTeX editor for iPad, iPod and iPhone. It is designed for fast navigation around LaTeX projects of all sizes. Given a single LaTeX root file, it will read through the LaTeX source, and that of all included files to present you with an outline of your project.

It is capable of typesetting the LaTeX and BibTeX source both locally and in the cloud with our secure servers. The resulting PDF can be viewed within Texpad along with a list of all errors or warnings encountered during the typeset process. Clicking on this list will navigate to the line of source responsible for the error.

### Contents

Appendix A. Disclaimers

# 1. Quick Start – The Organiser

The main starting point is the Organiser screen that shows up when you open Texpad. On your iPad, you will see the following screen

While on an iPhone or an iPod Touch,

The ‘Files’ button allows you to access all your files across different storages to add, delete and organise files. The ‘Create’ button is a shortcut for quickly creating a new project to work on.

The app may be customised via the ‘Settings’ button and these help pages may be viewed by tapping the ‘Help’ button.

Recently open documents are presented as a sliding list in above the buttons in the Organiser screen, allowing you to quickly open a document and start working on it.

Once a file or a multi-file project is opened in Texpad, the Project view provides a means to edit it, see its outline, typeset it to create a PDF, import files and image to it and export it via email.

# 2. Storing Files

## File Storage

Tapping on the ‘Files’ button in the Organiser brings up the Documents’ pane from where files across all your storages may be accessed. Texpad will store your LaTeX documents either in Dropbox or locally on your iPad/iPod/iPhone.

Storage Explanation
Local Storage:
The iPad/iPhone storage is the local, on-device storage. Working with this does not require internet connectivity as all files are stored on the device. This storage may be managed via iTunes.
Dropbox:
Dropbox storage requires a Dropbox account and working with files stored in your Dropbox folder requires internet connection. Texpad can access all files inside Apps/Texpad folder in your Dropbox. See below for more details on linking Texpad with your Dropbox account.
Texpad provides its own live syncing mechanism for collaborating across your different devices using Texpad, including Macs, iPads and iPhones as well as with other people.

The first time you start using Dropbox with Texpad, the app has to be linked with your Dropbox account. You can do so by tapping on ‘Linked with Dropbox’ in the Settings’ pane, or by accessing the Dropbox section in the Files pane.

If you have the official Dropbox app installed the following dialogue will appear

Select Allow in the bottom right hand corner to authorise Texpad to access files in your Apps/Texpad folder,

ln -s ~/Desktop/MyNextPaper ~/Dropbox/Apps/Texpad/MyNextPaper


After this you’ll be able to treat the two folders ~/Desktop/MyNextPaper and ~/Dropbox/Apps/Texpad/MyNextPaper as if they were the same (indeed they are same). The second folder will of course show up in your Texpad iOS’ Dropbox and allow you to work seamlessly on your files.

As a precaution, remember to backup your data where possible.

### Note to pre-v1.6.2 users:

Since Texpad 1.6.2 we have migrated from the Dropbox’s old Core API to their new Sync API. This was necessary to solve a number of bugs that have arisen since iOS7 and improve our Dropbox support. Unfortunately, Dropbox do not allow full Dropbox access to Apps using the new API, it requires all Applications to use their own App Folder. That is to say when you next boot Texpad it will create a folder named Texpad in the Apps folder, which can be found in the root of your Dropbox. You will need to move your files into that folder to continue using them with Texpad. See above note about creating symlinks to your existing folders.

### Linking with Dropbox on older iOS devices

Linking with Dropbox on older iOS devices (iPad 2 or equivalent) when the official Dropbox app is not installed on the device appears to be causing serious issues with the device such as crashes. Our investigations show that this is due to a memory bug in iOS’ web viewer that is used to link to Dropbox when the Dropbox app itself isn’t present. If you’re experiencing this issue, the only solution that appears to be fixing the problem is installing the Dropbox app, signing into your account in the app and then asking Texpad to link with Dropbox.

Although this problem does not affect newer devices, we strongly recommend installing the official Dropbox app as the stability of the native web viewer is causing other issues.

## Importing files into Texpad from other Apps

Texpad registers itself with the iOS device it is installed on as a candidate app for opening LaTeX-related file types such as .tex, .bib, etc. This may be used to import a file into Texpad. For instance, if you open a file in your Dropbox app on iOS, you see an Export button, in the bottom left corner,

Tapping it will bring the following dialogue

Here you may select Open in…, which will show Texpad as one of the options

Files imported in this way will be copied to the Texpad-Imported-Files folder in the root of your local iOS storage.

## Importing images into Texpad iOS

In the Documents pane, you can create an image in any folder accessible via Texpad by either using your device’s camera or by importing from your Photo Library. Simply tap on the ‘+’ button in a folder in one of Texpad’s local or Dropbox storages.

Images may also be imported directly into your LaTeX projects via their outline. Please see the section on ‘Working with Documents’.

Note: We’re often asked why Texpad is not listed in ‘Open in…’ dialogue for images. Users clearly wish to save images directly into their Texpad storage to include in their LaTeX documents. Well, sadly Apple won’t allow non-Apple apps to register for images.

• Use iTunes to add files to Texpad. See Apple’s guidelines for doing so for Apple apps: http://support.apple.com/kb/HT4094?v
• Add files to Dropbox and open them directly in Texpad or copy them in your iOS device’s local storage.

## Forcing Texpad to open non-standard included files

By default Texpad, on both iOS and macOS, examines your LaTeX source and opens any subfiles that have been included using tags such as

\include{x.tex}
\input{y.tex}
\usepackage{a}    % a.sty
\usepackage{subdirectory/b}    % b.sty in directory 'subdirectory'


Not only are these subfiles opened automatically, they’re listed in the Outline View for you to work with all your LaTeX code as a single project.

On iOS, these tags are even more crucial when working with Dropbox or using the cloud typesetter: files are detected for downloading from Dropbox and for dispatching to the cloud typesetters based on these tags.

If there are files that are not being recognised by default by Texpad, it is very likely to be due to their having a non-standard file extension. You may force Texpad to load such files using the following comment in your LaTeX source:

%force-texpad-dependency: file.ext


Note that the full or the relative path of the file must be specified including the extension.

## Non-standard native fonts with the cloud typesetter on iOS

The cloud typesetter only has the standard LaTeX OTF/TTF fonts installed on it, as it is impractical for us to buy licenses to all possible fonts and install them. Therefore if you wish to use a non-standard font with fontspec in the cloud (we are currently working on local Typesetter support for fontspec, but it is not ready yet), you will need to “attach” it to the project for upload.

You can do this with a directive of the form force-texpad-dependency: somefont.otf.

# 3. Working with Documents

## The Editor

Please see the keyboard and gestures articles for further tips and tricks on how to edit text.

### Automations

Texpad iOS comes with the same, well-developed editing automations as its desktop cousin. Features are

#### Autocomplete

This section lists the situations in which Texpad will offer completions for a LaTeX command.

• Command Autocompletion the simplest and most commonly used feature is that Texpad will offer autocomplete suggestions for simple commands. Documentation about that command is offered in a small window below the command

• Reference autofill once you type \\ref{ Texpad will list all references defined in your document as autocomplete suggestions.

• Include autofill if you type \include{, \includegraphics{ or \bibliography then Texpad will search for files with an extension appropriate to the command and offer them as autofills. You can also select directories and navigate in that way.

• Citation autofill if you type \cite{ then Texpad will search for references defined either as \\bibitems in your project’s TeX files, or as entries in an .bib file. These citekeys will be offered as autocomplete suggestions, and information about the citations is displayed below the autocomplete window.

#### Autoinsert

• Autoindent Any whitespace preceding the previous line will be automatically inserted when you start a new line.

• Parentheses Texpad will automatically insert a } for any {, and a [ for any ], etc. including a closing $ for any inserted $.

• begin/end matching Texpad will automatically insert a \end{XYZ} to match any \\begin{XYZ} you type when appropriate.

• \item autoinsertion Texpad will automatically insert \item commands when you begin an itemize, description or enumerate environment. Further items will be autoinserted as you press return

### Inline error checking

Texpad will periodically run LaTeX in the background on your documents. When it finds errors attached to a line it will show a red marker on the left in the outline view. Tap this to reveal a popover with the error text in it.

The Outline button in the top left corner will slide the editor screen to the right and reveal the document outline view.
Tap the Search button to hunt for a search term in all open files. If you are familiar with regular expression (regexes), any term surrounded by forward slashes will be interpreted as a regex, for example searching for /state[sd]?/ will return instances of state, states and stated.
The settings button will open an abbreviated settings window. You can choose to typeset in either the cloud or locally from here, you can also select the editor font and size.
The Typeset button will start and stop typesetting (please choose from cloud or local in the settings menu). Whilst the typeset is in progress the button will spin - pressing it a second time will cancel the typeset.
Press the Log button to view any errors or warnings raised by LaTeX during the previous typeset. If there are no issues but you wish to see the log anyway, then please press it a second time.
Tap the PDF button to see the PDF created by LaTeX. When working with Markdown there is no need to typeset explicitly, simply press this button and the document will be re-typeset if there have been changes since the previous typeset.

## The Keyboard

Since 1.7.7, Texpad uses the regular iOS keyboard, along with a small keystrip along the top with LaTeX specific symbols.

### Bluetooth keyboard

Texpad is designed to work with the Bluetooth keyboard, and the larger iPad Pro in general.

## Document Outline

On the iPhone, the outline view can be found by navigating left from the document, and on the iPad it is revealed by pressing the three horizontal bars. This view contains a lot of information about your document, the files it includes and allows you import files into the document and export from the document.

### Information

At the top of the document outline view there is a small information pane showing the name of the document, the number of files included, and gives you buttons allowing you to either open the containing folder in the files pane, or import the project into Texpad Connect. With a Texpad Connect project there will be a switch here that allows you to turn on and off Live Synchronisation.

### Document outline

The document outline itself shows all include markers, \part, \chapter, \section, \subsection commands in your project as a hierarchical list. This shows you the logical structure of your document. Tap the markers to jump to the corresponding position in the document.

Additionally Texpad will look for any comments containing TODO, or LaTeX \todo commands and it displays these in the document outline as a reminder to you.

### Search (iPhone only)

On iPad the search is accessible from the main editor view, but on the iPhone the searchbox will appear in the outline view. Enter a term to search for it, and Texpad will show the results on the outline view itself.

### Files/Images

Texpad will list all files in the project here, along with any files in the subfiles/ folder. To insert a file, place the cursor in the editor and tap the file, the relevant \include{} command will be inserted into your document.

The same is true for images, which will be listed in the images section, along with any images in the images/ folder.

To delete files and images, press edit, select the file(s) then press the trash button.

### Import

The leftmost icon on the toolbar at the bottom of this view is the import button. Press this and you will be given the choice to import a new file into your project by either choosing an existing file from the filesystem or importing an image from the camera roll.

To create a new file, press the add button, enter the filename and press ok. It will be created in the subfiles/ folder.

### Export

To email either the source files, the pdf, a zip of both, or to open the source files in an external application please press the export button and choose the appropriate option.

## Undo

There are two ways to undo in Texpad.

Shake to undo: the standard iOS shake gesture will open the following

Undo button: The keyboard has an undo button on the numbers pane, and a redo button on the symbols pane.

# 4. Typesetting

## 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.

## 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}
\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

# 5. Errors in your LaTeX Code

Finding and fixing errors in your LaTeX source code couldn’t be easier in Texpad. Just like the OS X version, errors and warnings generated in a typeset are presented in a navigable list. This list is easily accessibly using the little bug icon in the bar below the editor

If a typeset results in errors, the error list is automatically presented to you,

Tapping on the error takes you straight to the offending line in the code. The errors are also highlighted in the editor with a red marker on the corresponding line number

Tapping on the red marker shows the error description

Some errors may require you to dig a little deeper into the raw typeset log generated by LaTeX. This log is fully accessible to you too:

• On the iPhone: Tap on the row See full LaTeX error log… in the error list.
• On the iPad: Tap on the bug icon twice.

# 6. Searching your LaTeX Documents

Like Texpad on OS X, the iOS versions come with global search across all the documents in your LaTeX project. In the iPad app, the Search button sits in the top menu bar over the editor:

whereas in the iPhone/iPod version, it resides in the document Outline View as shown below:

Search results are presented as a list that you can click to navigate to corresponding lines:

# 7. Managing LaTeX Bundles

## Why do we need a Bundle Manager for LaTeX packages?

LaTeX packages that get shipped with Texpad iOS form a subset of the full LaTeX distribution that is a large and monolithic. It is designed that way so as to cater a broad range of typesetting needs. Not only would it be unnecessary to pre-install all these packages in Texpad iOS, it would also result in a very large app, taking up up to half a gigabyte of space on your device. Texpad’s Bundle Manager helps distribute these additional packages as they are needed. It may be accessed from the Settings’ pane:

Clicking on “LaTeX Bundle Manager” shows what options are available for install:

## What do different bundle icons mean?

Icon Explanation
Bundles in green are pre-installed. They do not need to be installed by users, nor may they be uninstalled by them.
Bundles in blue are user-installed bundles.
Bundles in grey are available, but uninstalled.

## Installing new bundles

When you typeset a document that relies on a package that’s missing from the pre-installed (and your current list of additionally installed) bundles, the Error Log flags it as shown below

It tells you what bundle needs to be installed to get the missing package. Generally, it’s best not to install a bundle unless the Error Log tells you to do so.

Installing a bundle is easy: you simply find it in the Bundle Manager’s list of bundles. Clicking on it will bring up a view of the following type:

This tells you how big the bundle is: the Download Size is the compressed size and Space Required is the storage space you need on your iOS device for installing the bundle with all its dependencies, which are listed just below. Once you’ve clicked on the ON/OFF button to install the bundle, it gets marked as such:

## Uninstalling bundles

To uninstall a bundle, just switch off the install button.

## Editor Preferences

You may customise your editor by changing the font and size for all documents.

## Encoding

Choose the file encoding you wish to work with. Be careful because if you choose the wrong encoding your documents will fail to open. We recommend you work with UTF-8, it is the most compatible, most widely used and by far the most hassle free option.

## Typesetting Preferences

The local typesetter provides the most standard typesetting engines, pdfLaTeX and BibTeX. In addition to the standard options, the cloud typesetter however, provides non-standard typesetting chains such as XeLaTeX and pLaTeX (for Japanese) as well as Biber. Please use these with care, and only for documents that explicitly require it. Once done with such documents, remember to revert the options back to the standard ones.

In addition to the above, you may link and unlink to Dropbox as well as manage your LaTeX packages via the bundle manager. See above sections.

# Appendix A. Disclaimers

## External Licences

### Bundled Fonts

This application uses code based on EGOTextView which is used under the following license:

Created by Devin Doty on 4/18/11.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


The underlying LaTeX and BibTeX engines are built upon kerTeX-based TeX distribution with the following license (note that the text is a verbatim copy of the relevant section of file COPYRIGHTS.kerTeX in the kerTeX bundle):

EXTERNAL SOURCES (reorganised for link with kerTeX), USED BUT NEITHER DIRECTLY INCLUDED NOR COVERED BY THE LICENCE

Donald E. Knuth's whole system for digital typesetting (METAFONT, CM, TeX) and utilities, plus WEB, and, with Silvio Levy, CWEB. This software is still maintained by the author; but the licence permits the use, the compilation and the distribution of named results mf(1) and tex(1) if the implementation passes the torture tests. They do. [in "Knuth" sources]
Silvio Levy for CWEB with Donald E. Knuth (Silvio Levy still maitaining as far as I know). ["Knuth" sources]
Oren Patashnik for BibTeX (0.99d). (same type of licence as the one covering D.E. Knuth's work). Still maintained by author as far as I know. [bibtex sources]
The NTS team for e-TeX (v2.1) : Joachim Lammarsch, Philip Taylor, Peter Breitenlohner, Jiri Zlatuska, Bernd Raichle, Friedhelm Sowa. Licence TeX one like. [etex "sources"]
The AMS provided supplementary fonts and/or font formats (i.e. the CM related pfb files), version 3.02, are included here and are covered by the SIL licence. See OFL.txt. [ams "sources"]

BULK WORK OF WHAT IS DIRECTLY INCLUDED
The main authors of the original code _included here_ were:
Tomas Rokicki for dvips (5.76, was Public Domain) and dvips auxiliary programs.
John Hobby from ATT for MetaPost (public domain 0.641).
Donald E. Knuth for programs _included here_ with Tomas Rokicki for dvips auxiliary tools.
Tanmoy Bhattacharya for the hyperbasics.tex macro file (public domain).

The AUTHORS stands for:
- The original authors listed above, for credits. But they have no responsability for the present resulting work.
- Thierry LARONDE .

kerTeX PUBLIC LICENCE
version 1.0

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software must display the following acknowledgement:

This product includes software developed for kerTeX by the AUTHORS.
This advertisement must be conspicuous but can be made by directing the user to an easily accessible file listing the AUTHORS. For example, the generic sentence:
This product includes software developed by third parties. See the file THE_AUTHORS for details.
is OK.
4. Neither the name of kerTeX nor the names of the AUTHORS may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHORS AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE KERGIS PROJECT OR THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR ITS USE OR DEALING, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

YOU USE THIS SOFTWARE AT YOUR OWN RISK AND UNDER YOUR OWN RESPONSABILITY AND USING IT IMPLIES ACCEPTATION OF THE TERMS OF THIS LICENCE.

THIS AGREEMENT IS GOVERNED BY THE LAWS OF FRANCE.

RATIONAL: This present alinea is just informal. The licence has two main goals: give credit to the ones who have made the work; forbid the stealing of the credits from the authors, and of the work for the users, making what has been given mainly by Donald E. Knuth hard to find or to use. In clear: this licence is against mob programming''.