TeXPortal, a TeX system for Android

If you’re an Android user looking for a complete TEX system in a tablet, here is a glad news waiting for you . An application namely, TEXPortal in combination with TEXpert will make a complete TEX system in your Android tablet or smart phone. TEXPortal is a complete TEXLive distribution ported for Android and TEXpert is a full fledged text editor and integrated development environment within which the user can create, edit, run the compiler, view and debug without leaving it. The user interface is uncluttered, elegantly simple and very easy to use that will put to shame some of the cloud based frameworks that have germinated in the fertile soil of Internet in recent times.

shot-tp-3
Figure 1: A screen shot of source, output and the keyboard in a Nexus 9 tablet.

The big advantage of TEXPortal is that any non-geeky user can set it up without any feeling of intimidation and is as breezy as the installation of any other Android application. As such anybody who has a user knowledge of TEX can make a try confidently. Standard TEXLive installation in desktops need around 300 Meg space while TEXPortal needs only 2 Meg for pdfTEX alone plus 40 Meg for LATEX, half of which will be installed on the fly as and when need arises. Hence, this is a big boon for limited storage devices.

The main features include:

  • TEXPortal is optimized for mobile devices.
  • It is a complete TEXLive distribution ported for Android, keeping a minimal installation to begin with. However, as and when the submitted documents require more and more advanced packages, those will be downloaded dynamically from CTAN and installed as and when needed, provided the device is connected to the Internet.
  • All popular macro libraries like LATEX and ConTEXt are available.
shot-tp-1
Figure 2: A screen shot of source and compiled output of a document that uses a relatively complicated document class and supporting packages.
  • All standard compilers like TEX, pdfTEX, XeTEX and LuaTEX are available.
  • Internet connection is not mandatory for TEXPortal to work if the user does not want to download any package from CTAN.
  • The output shown on the right is not in PDF format, but is a .png version of the output which makes the loading and refreshing output with repeated runs of TEX faster. TEXpert has its own integrated viewer.

Non-Latin documents

Given below is a screen shot (Figure 3) of a document written in Malayalam (a language with complex script spoken in Kerala, southern India where I live) and compiled using XeLATEX. I have used a nice custom font, viz., Rachana and XeTEX did its job very well without any hassles. To install this font in my Android devices, I just needed to create a sub-directory Fonts in the sd card and copy the .ttf or .otf version of the font to the Fonts directory. Once this is completed, we need to regenerate the font cache afresh by pressing the menu item Generate Fonts Cache in the left panel of TEXPortal interface (See Figure 5) to facilitate XeTEX to access system fonts.

shot-tp-5
Figure 3: A screen shot of source and output of a Malayalam document.
  • TEXPortal provides a big advantage of keeping document sources locally in user’s devices, instead of uploading to or authoring in a remote server controlled by third parties.
  • Since there is no need to send document sources to a remote server and run it from there, the output generation is faster, debugging is easier and no data charges are incurred. Edit–compile–view–debug cycle is relatively hassle-free than in a cloud based framework.
  • Confidentiality of data, which is of paramount importance for researchers till the article is published or released in a preprint server like arXiv, is seldom compromised. Additionally, the system works fine even if you’re on a plane.
  • No rooting of the device is necessary.
shot-tp-2
Figure 4: A screen shot of source and output of the documentation of tufte document class.

All the fonts that are downloadable from CTAN can be installed in TEXPortal as with any packages. I have tested many fonts like Libertine, Charter, mathpazo, Source Sans Pro, Inconsolata, newtxmath, and many more. Everything worked like a charm to my entire satisfaction.

Functionality of TEXPortal

The screen shot in Figure 5 shows how TEXPortal downloads and installs missing packages when a document is typeset. In this case, when I tried to typeset the Malayalam document shown in Figure 3, packages like, fontspec, l3kernel, l3packages, etc., were not found in the device and hence those are being installed (see the right panel).

The interface has been vertically divided into two — left and right panels. The left panel is further divided into four parts:

  1. Compilation
  2. Kill Process
  3. Installation
  4. Management

The screen shots of a smart phone showing various menus are available here. It might be useful to take a look at these shots.

  • The Compilation menu has two items, the first line is a choice menu where one can choose from, tex, latex, context, pdftex, pdflatex, xetex, xelatex, luatex, lualatex, bibtex, dvips, makeindex, metapost, ps2pdf and eps2pdf. One can see that most of the binary programs needed are covered in the above list except TEX4ht and related stuff. We need to explore further so that html generation from TEX sources becomes a handy affair. On the right of this we have a start button to start a compilation job with the chosen compiler.
  • The second line where the submitted file name with path is given, which when touched, will open up a file dialog box through which the user can easily select the desired input file.
  • The Kill button allows to terminate a process if you know the pid of that process which can be provided left of the button.
  • The user can install individual packages from CTAN if he desires so by providing the package name at Packages to install and the Install button does the job.
  • Open button helps to see the TEX installation location with File Manager application (or similar one, a choice of apps available are presented from which users might choose) and do any kind of file operations. The tree structure is compliant with TDS.
  • The Management menu provides four buttons:
    • Grant Storage Permission — to grant TEXPortal necessary permission to a folder to execute its job.
    • Generate Fonts Cache — refresh system fonts cache when new fonts are installed in the device.
    • Reload ConTEXt Fonts — refresh font list for ConTEXt.
    • Edit pdfTEX Font Map — edit font map file used by pdfTEX.
shot-tp-4
Figure 5: A screen shot of source, output and the keyboard.

The screen shot in Figure 6 provides the scenario when a compilation of a document is finished. Users at their will can open the log file by pressing on the pencil icon found at the right top of the window. Other icons are self explanatory (clockwise from top left): refresh (can be used for recompile also); view pdf; show log; clear entry.

shot-tp-6
Figure 6: A screen shot of TEXPortal window showing the log of the most recent TEX run.

TEXpert, the integrated editor

The action panel as shown in the screen shot in Figure 7 can be activate by swiping from left edge to right of the display. The panel provides several icons that are self-explanatory. The only thing that needs to be pointed out is that the panel also provides headings of various sectional units and graphic files names of included as in an outline.

  • Compile document: click to compile with primary engine (pdfLATEX by default), long click to do BibTEX.
  • Open document: click on the button to browse your SD card, Google Drive or Dropbox for the document to open, long click to pick up a document from a list of recently opened document.
  • View PDF: click to view PDF (either split the screen or show the PDF full screen, depending on how you last close the PDF viewer), when the PDF viewer opens, it will attempt to jump to the position corresponding to the cursor position, long click to view PDF in external app such as Adobe Reader.
  • Extra keyboard: can select which keys to show in the Settings.

screen shot image
Figure 7: Screen shot of action panel of TEXpert as seen in a smart phone.

Following commands are available if compatible keyboard is chosen. The
application namely, Hackers’ Keyboard is the one that I used for this
purpose.

  • File commands
    • Ctrl+N Create new document
    • Ctrl+O Open existing document (from SD card, Google Drive or Dropbox)
    • Ctrl+S Save current document
    • Ctrl+T or F1 Compile main document using the primary engine
      (pdfLATEX by default, change in Settings).
    • Ctrl+B or F2 Do BibTEX
    • Ctrl+P View PDF: either split the screen to show the editor and PDF side-by-side or show PDF in full screen. Then jump to the PDF position corresponding to the code location at the editor’s cursor.
  • Editing commands
    • Ctrl+Z Undo
    • Ctrl+Y Redo
    • Ctrl+A Select all
    • Ctrl+C Copy
    • Ctrl+X Cut
    • Ctrl+V Paste
    • Ctrl+K Comment the selected block
    • Ctrl+Shift+K Uncomment the selected block
    • Tab Expand the word at cursor using defined expansion pattern
    • Ctrl+I Go to next insertion point #INS# in the expanded text
    • Ctrl+Tab Insert tab character to the text
    • Shift+Arrow keys Select block for copy/paste/comment

TEXpert provides an embedded PDF viewer that can be displayed along side with the document. It provides fast syntax highlighting with little lagging. Noteworthy capability is mathematical formula highlighting, a feature rarely provided by editors.

Beyond that, TEXpert understands LATEX unlike general purpose text editors. It offers easy access to frequently used symbols in LATEX documents such as dollar and backslash, hierarchical document outline (i.e. \chapter, \section, \subsection, etc.), annotated log, etc. TEXpert also provides smart code completion and is user configurable.

Additional applications

A few additional applications are useful to make the TEXPortal setup more productive and convenient. Dropsync and Foldersync help user to sync a designated folder in Dropbox or a variety of cloud frameworks to sync with a folder in the Android devices.

Dropsync

Dropsync lets you automatically sync and share unlimited files and folders with Dropbox and with your other trusted devices. Sync and share any files! Photos, videos, documents, PDF, MP3, ebooks, backups, …

  • Full two-way auto-sync running in background, just like Dropbox on desktop.
  • Many sync modes. Not only two-way, you can also choose Upload only, Upload then delete, Download only, Download mirror, …
  • Instant upload: new files are uploaded to Dropbox immediately.
  • Very efficient, consumes almost no battery.
  • Easy to set up. Once set up files will be kept in sync without any effort from users.
  • Works reliably under ever changing network conditions on your phone.
  • Monitors battery level, WiFi/3G/4G/LTE/WiMax connectivity and adapts its behavior according to user preferences.
  • Configurable auto-sync interval: 15 minutes, 30 minutes, every hour,…
  • Tasker plugin to allow power users to define sophisticated sync schedules and conditions.

Foldersync

FolderSync enables simple sync to cloud based storage to and from local folders on the device SD cards. It support a wide range of different cloud providers and file protocols, and support for more platforms are added continuously. Root file access also supported on rooted devices.

Supported cloud providers

  • Amazon Cloud Drive
  • Amazon S3 Simple Storage Service
  • Box
  • CloudMe (using WebDAV)
  • Copy.com
  • Cubby (using WebDAV)
  • Digitalbucket.net (using WebDAV)
  • Dropbox
  • Dump Truck (using WebDAV)
  • GoDaddy (using WebDAV)
  • Google Drive
  • HiDrive (using WebDAV)
  • Livedrive Premium (using WebDAV)
  • MEGA
  • MyDrive.ch (using WebDAV)
  • NetDocuments (using WebDAV)
  • OneDrive
  • SugarSync
  • WEB.DE (using WebDAV)
  • Yandex Disk (using WebDAV)

Supported protocols

  • FTP
  • FTPS (SSL/TLS implicit)
  • FTPES (SSL/TLS explicit)
  • SFTP (SSH File Transfer)
  • Samba/CIFS/Windows Share
  • WebDAV (HTTP/HTTPS)

Hacker’s Keyboard

Hacker’s Keyboard is very much needed as many commands in TEXPortal is a combination of control and alt with other keys which are provided by this application (see the keyboard in Figure 1). Also, it has tab, escape, arrow keys, braces and backslash as in a standard keyboard which is very hand makes editing TEX documents a pleasure.

Overall Assessment

A few hours of tinkering with the application ended up in a sleek TEXLive installation in my Nexus 9 tablet and OnePlusOne phone that can compile any document in my desktop seamlessly. It is indeed a pleasure to tweak a macro and/or a package on the road without the need for a desktop.

The big advantage of this application is its ability to keep my data and packages confined to my devices till they are published instead of allowing it to be transported to a cloud server controlled by others. Even in terms of money, the cost of Pro version of TEXPortal is $10 and for TEXpert is another $ 10 which I happily paid for its efficient functionality and as an expression of my gratitude to the developers who did a great work in porting TEXLive to Android. Still it is far economical than maintaining a paid account in Overleaf or ShareLATEX.

10 Responses to “TeXPortal, a TeX system for Android”


  • Thanks for the detailed report, very useful!

  • Thanks, CVR!

    Glyph for dots doesn’t seem to be in Rachana. Wondering if it makes sense to add…

  • are the sources available? didn’t see it on their web site, aside from one utility. lots of stuff in TL is under the GPL or LGPL. as you know.

    • I didn’t search for the sources as I was under the impression that sources shall be available since the underlying software should have been generated from sources licensed under GPL. The default compiler is pdfTeX (GPL) which in turn is dependent on kpathsea libraries, again GPL. Guess, sources will be made available if asked for, at least that is what is expected from them.

  • Nice review! I just wonder why you are calling your blog `blue danube` – living in Vienna and Linz, this has of course a meaning to me, but for people in India… 🙂

    • Thanks, Werner!

      I do understand, Werner, you have special meaning for “blue danube” especially when you are more intimately related to music. Although it is apparently improbable, I too have, but not so similar, relationship with “danube” ever since I happened to read an article entitled “blue music” (നീലസംഗീതം) by Maethil Radhakrishnan (മേതില്‍ രാധാകൃഷ്ണന്‍) written in Malayalam, during my school days. I was greatly influenced by the article, which described about the classical music traditions prevalent in Vienna, with special reference to An der schönen blauen Donau, Op. 314, a waltz by Johann Strauss II. I need not tell anything about this waltz to you. Since then, it took several years for me to secure a disk of Blue Danube because in my forest-like native village, no resources or outlets were available to gather one. Then onwards Danube has had a great influence on me that the name of my system in our Linux network is also “danube”.

      • Thanks for the details! I guess that you are regularly viewing the New Year Concert of the Vienna Philharmonic Orchestra on TV, right? 🙂

        • Yes, I do, not on TV, rely mostly on YouTube. But this year’s hasn’t been released in full for copyright reasons. The discs have been released by Sony Classic and I am waiting for it to reach Indian outlets. I am particularly curious to get a copy as Zubin Mehta conducted this year’s concert.

Leave a Reply to Norbert Preining