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.

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

Figure 3: A screen shot of source and output of a Malayalam document.
  • TEXPortal provides a big advantage of keeping document sources locally in the user’s devices, instead of uploading to or authoring in a remote server controlled by third parties.
  • Since there is no need to send the 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.
Figure 4: A screen shot of source and output of the documentation of tufte document class.

All the fonts 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.
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.

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

  • 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 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 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

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 my expression of 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.

TLC in ePub format

Frank Mittelbach and Michel Goossens, with Johannes Braams, David Carlisle, and Chris Rowley. The LATEX Companion -– 2nd ed. Includes bibliographical references and index. ISBN 0-201-36299-6. 2004, Pearson Education, Inc., Boston, MA.

TeX Lion

Courtesey: Paulo Cereda

The 1,200 pages long The LATEX Companion (TLC) is now available in a variety of ebook formats — ePUB, mobi and PDF. To quote Frank Mittelbach:
Continue reading ‘TLC in ePub format’

Plagiarized Website

RIVER-VALLEY.COM is a domain name which I have been holding since 26 March, 1998. I had allowed the domain name to be used by Focal Image (India) Private Limited, an IT enabled service company located in Trivandrum, India of which I am one of the directors. All versions of the website of this domain from October 1999 to till date are also available at Internet Archive.

Continue reading ‘Plagiarized Website’

TeX4ht and Multicolumn Layout

Nasser M. Abbassi had filed a feature request at TeX4ht project for multicolumn support in TeX4ht which is lacking at the moment. This link provides the latest specifications of W3C relating to multicolumn layout in HTML which some of the mainstream browsers support in varying degrees. Our initial efforts are pointed towards multicol package so that TeX4ht provides enough hooks to generate output with multicolumn layout as envisaged in LATEX by multicol package. Support for \twocolumn still remains to be done, though.

Continue reading ‘TeX4ht and Multicolumn Layout’

Aaron, the passionate liberator

Lawrence Lessig and Aaron Swartz

Lawrence Lessig and Aaron Swartz in 2002 (Courtesy Wikipedia)

The intellectual hoarders around the world would have heaved a sigh of relief when they heard about the tragic death of Aaron Swartz. The Hindu rightly pointed out that the world had become poorer with the death of this computing genius and passionate activist who stood for free access to knowledge and information in the Internet. He worked hard to free information vaulted behind pay walls. In that effort, the young adventurer in him coupled with his programing prowess succeeded to download 4.8 million articles from the digital library of JSTOR and distributed freely in the Internet. Continue reading ‘Aaron, the passionate liberator’

Biblatex 2.5

Two updates have already been made for biblatex since we tested compatibility problems of TeX4ht with the package last. This time, except for one change of the string, URL, which was hardwired in previous versions, becoming a localization string, all the remaining changes relate to biber, the bib database processor. None of these have any bearing on TeX4ht. However, a thorough run of all example files in the package bundle has been done and could not find any problems in generating HTML output identical to the PDF counterparts.

Continue reading ‘Biblatex 2.5′

Biblatex 2.3

You might have noted that biblatex has been updated to version 2.3 and the documentation documentation says:

If an entry in the revision history states that a feature has been improved or extended, this indicates a modification which either does not affect the syntax and behavior of the package or is syntactically backwards compatible (such as the addition of an optional argument to an existing command). Entries stating that a feature has been modified, renamed, or removed demand attention. They indicate a modification which may require changes to existing styles or documents in some, hopefully rare, cases.

Continue reading ‘Biblatex 2.3′

An Annotated TeX Source

Mahesh wanted to see the annotated source of the TeX document that generated the output shown here. There are two components in the source:  (1) document source, let us call it as test.tex, (2) a custom configuration for TeX4ht, let us call it as my.cfg.
Continue reading ‘An Annotated TeX Source’

TeX4ht Supports Lettrine

Raphaël Pinson has kindly contributed the code that enables TeX4ht to support lettrine package. (lettrine.sty helps to typeset dropped capitals in a LaTeX document.) This probably will solve the long standing problem of drop capital support in TeX4ht, even if all the options of lettrine package are not supported at this time. Hope, Raphaël will continue support to enhance TeX4ht by adding all the missing options of lettrine.

Continue reading ‘TeX4ht Supports Lettrine’

TeX4ht and BibLaTeX 2.2

TeX4ht has been updated to cope with the newest incarnation of biblatex ver. 2.2. All its 43 example files provided with documentation have been tested and seem to work fine. Each example file with html output plus all the auxiliary files generated have been archived and provided below for users to check for problems, if any. The revised package of biblatex.4ht is also provided along with recent version of nameref.4ht which some users may not have owing to its recent updation. Older version of nameref.4ht can cause problems when biblatex is run in conjuction with hyperref.

Continue reading ‘TeX4ht and BibLaTeX 2.2′