We are the group of developers behind various Android app dealing with TeX/LaTeX such as our user-friendly TeX/LaTeX compiler TeXPortal and our modern LaTeX editor TeXpert. This is our main support page where you will find lots of information relating to our distributed software.
For your enquiries and feedback, please send email to lameandroidhero at Google mail. We prefer having the name of the app and the nature of your enquiry to email subject.
Please note that we do not provide refund at personal request unless for specified reasons. Google Play gives a 15 minute grace period to test your purchased app. If you are not happy with the purchased application, please get the refund within this period via Google Play by yourself.
Under no circumstance will our app collect your personal data, save it to our server or publish for third-party.
Even so, bear in mind that we do use third-party advertisement API (Google's admob for particular example) and we do not know its working under the hood. Neither are we aware of Android's internal working so we cannot guarantee that your data is never collected or misused by third-party such as Google or your device manufacturer.
TeXPortal is an application to typeset TeX documents, targeting mainly at academic researchers.
As its primary goal, TeXPortal HELPs compile their TeX documents on Android devices using common TeX engines such as TeX, pdfTeX, XeTeX, LuaTeX i.e. generate DVI, PDF output from the source code. Other useful companion programs commonly used by researcher (BibTeX, MakeIndex, MetaPost) are also provided. Of course, to be useful, a large collection of macro packages as those in Comprehensive TeX Archive Network (CTAN, TeX Live) is also supported.
There are available TeX compiling applications in Android market. Unfortunately, they mainly send the document to a remote server to handle the compilation task and then download the result. TeXPortal really works locally (but requires Internet access for downloading additional packages) and this is strongly desirable on mobile devices. It is a huge data bandwidth and waiting time saver in mobile devices where network access (usually wireless) is costly (3G/4G data plan) and much slower than wired access on PC. Local compilation also forstalls security issue of having to send document to unverified server. This also means TeX is always available, even if you are on a plane to your conference where no network access is available.
A secondary goal is to make TeX more amicable to users . To do that, we improvise a feature to resolve errors automatically by installing the right missing packages using hints in the generated log. This has an advantage of being much simpler (and hopefully more efficient) than MiKTeX, which probably performs lots of intercepts in TeX.
Beyond that, a noteworthy advantage of TeXPortal is its minimalistic approach. That is to say, it acquires only necessary packages .
Major TeX distributions in PC install most TeX engines and accompanying utilities available. Because of that, they gorge lots of storage space. MiKTeX, for instance, consumes 300MB in its basic scheme; a similar amount is applicable to TeXLive. This is a huge space wastage since many users do not touch most distributed programs. A basic TeXPortal installation requires 2MB (for pdfTeX only) and 40MB for basic LaTeX packages (half of that if download packages are deleted), a saving factor of 5, extremely useful in limited storage mobile devices.
Last but not least, TeXPortal does not require
rooting
the device, unlike various dangerous methods available
such as installing and utilizing a full Linux distributions via
chroot
. The advantage (of such approach) might be the availability of all
TeX utilities at the expense of technical competence requirement
from user's side.
All operations are available in actions panel which is embedded in the UI on the left side (for large screen) or can be drawn out by dragging finger from the left edge of the screen. Compilation and package installation should be trivial.
This is some solution where one wants to forcibly kill a process started by TeXPortal such as compiling infinitely loop documents. As the last resort, TeXPortal allows user to kill a process it spawned. To do that, one needs to pick up process ID using some terminal emulator app.
Generation of font configuration is necessary if one intends to use XeTeX. Do it after font installation.
The settings panel can be drawn from the right edge. Current
version allows one to change location to obtain packages: either
from the developer's public Dropbox folder (recommended), one of
TeX Live online archive or a local folder. Another option is the
location to put TeX packages, indicated as TeXMF
Root
. The default location is TeXPortal's public folder which will
be deleted after TeXPortal is uninstalled. The last option is for
supported languages to use with package
babel
. US English is always enabled by default.
Under TEXMF root folder (c.f. above section), you might find
several folders whose name starts with texmf such as texmf,
texmf-dist, texmf-var. Let
TEXMF
refers to any of them.
LaTeX styles files (*.sty) should be placed in
TEXMF/tex/latex/*/
where
*
can be any folder. For example, you can make a folder
personal
in
TEXMF/tex/latex/
and then places all your personal styles there.
Many LaTeX packages such as shortlst or undertilde are distributed in source form ( *.dtx files , *.ins files). These packages usually need to be compiled into *.sty to be usable. In those cases, please consult their manuals for installation instructions. A good reference is this entry in LaTeX wikibook.
Note: After copying files into anywhere under
TEXMF
, one needs to update path databases. In TeXPortal, this is
achieved by installing an empty list of package.
This is a hard task which depends on the engine and we totally discourage users from installing custom fonts. Anyway, a good reference is again an article from LaTeX wikibook.
In general, to install fonts, there are two steps:
(i)
Produce the font files (if necessary) and copy relevant files to
correct locations (followed by path database update): font-related
files (vf, afm, tfm, type1) should go to somewhere within
TEXMF/fonts/
while *.sty, *.fd should go to
TEXMF/tex/latex/*/
as above.
(ii) For fonts to be used in pdfTeX, one needs to
add correct entries to font map file
TEXMF/fonts/map/pdftex/updmap/pdftex.map
. (TeXPortal provides a button to open this file in external
editor.) Typically, font packages provide a *.map which
should simply be appended to
pdftex.map
.
Our advice is that one should switch to modern engines like LuaTeX which simplifies much of font handling and automatically generates the necessary configurations at runtime.
No. It used to be. Please consult our developer guide if you wish to develop applications that make advantage of TeX.
Note that TeXPortal uses the *TeX engines as command line programs from TeX Live project whose source code is available at TeX Live. You can grab a copy from our website as well. We compile the engines for Android with the help of the Android NDK released by Google. There is no linkage [in DLL/LIB/SO-sense of the word] between TeXPortal and the engines.
The paid version supports many features such as other engines (bibtex, luatex, metapost, ps2pdf), custom package installation, customize location of packages, customize babel languages, and kill a spawn process. The free version source code lags roughly 300-500 revisions behind the paid one.
Why can't I compile in background with TeXPortal Free?Because the free version does not have feature to kill a spawned process, you might end up having indefinitely run processes in case TeXPortal is nominated to be killed by the Android system while running in the background. In that case, the only solution is to reset the device and this is undesirable. (The author already encountered this situation.)
Why is TeXPortal Free generally slower than paid version?The free version provides advertisement feature and thus, suffers a bit in term of performance; for example, it has to perform garbage collection more frequently than paid version. As mentioned, free version's source code lags and is not enhanced anymore so it generally lacks a lot of bug fixes discovered in the development of the paid one. This is also the reason most features are stripped off.
What are the requested permissions for?
We require INTERNET
and ACCESS_NETWORK_STATE
to download
additional packages and WRITE_EXTERNAL_STORAGE
to write compilation
outputs (PDF file, log, whatever) to sdcard. The free version in
addition requires READ_PHONE_STATE
, ACCESS_WIFI_STATE
and
ACCESS_COARSE_LOCATION
to track app usage and provide targeted
advertisements.
TeXPortal can be invoked by external app to compile documents. This comes in handy if you want to make use of TeXPortal, for instance, in your TeX editing app. The following code snipet, which should be put in your activity, is to display a dialog to compile a file. For security reason, TeXPortal needs user consent to do compilation.
static final String TPARG_ENGINE = "TP_ENGINE"; static final ComponentName TEXPORTAL = new ComponentName("lah.texportal.donate", "lah.texportal.CompileDocumentActivity"); startActivityForResult(new Intent().setComponent(TEXPORTAL) .setData(Uri.fromFile(file_to_compile)) .putExtra(TPARG_ENGINE, engine), TEXPORTAL_REQUEST_CODE);
Then, override method
onActivityResult
of your activity to get information returned by TeXPortal about
user action.
static final String TP_TASK_ID = "TP_TASK_ID"; static final String TP_TASK_STATE = "TP_TASK_STATE"; @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case TEXPORTAL_REQUEST_CODE: if (resultCode == RESULT_OK) { // User consent the request int task_id = data.getIntExtra(TP_TASK_ID, 0); String task_status = data.getStringExtra(TP_TASK_STATE); } else if (resultCode == RESULT_CANCELED) { // User cancel } break; } }
TeXPortal broadcasts the state changes of a task. To obtain
information, implement and register a
BroadcastReceiver
with the following intent filter:
<intent-filter> <action android:name="lah.texportal.NOTIFY_COMPILATION_STATUS" /> </intent-filter>
TeXpert is LaTeX integrated writing app for Android.
As an integrated environment, TeXpert allows users to execute writing cycles (edit, compile (generate PDF output) via TeXPortal and view the result). As a result, it provides the convenience and productivity because it eliminates the hassles of switching back and forth between different applications. Meaning: one does not have to open, say TeXPortal, to (re)compile the document and wait for it to complete then open generated PDF with another app; finally using Android's Recent apps button or re-open the editing app to go back to continue editing the file.
The user interface is designed with usability optimization purpose. For instance, scrollbar is added for fast scrolling through the document.
TeXpert provides an embedded PDF viewer that can be displayed along side with the document.
Remark: TeXPortal is required to compile documents.
TeXpert provides fast syntax highlighting with little lagging. Noteworthy capability is mathematical formula highlighting , a feature rarely provided by editors. Even on PC, only TeX Maker seems to provide that capability.
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.; Version 2.3.2 goes a step further by considering beamer
frame
's.), annotated log, etc. These features facilitate much better
navigation because writer usually works on organizational units and
also help in debugging process.
TeXpert also provides smart code completion.
Further than being an editor, TeXpert simplifies
lots of mundane storage operations
such as downloading, editing
and then uploading files back to cloud storage such as Dropbox. Not
only that, from version 2.3.2, it hints user and acquires
necessary resources
for compilation, namely images in
\includegraphics
command or additional source in
\input
command and even bibliographic database. How inconvenience it is
having to download all those files individually!
\input
, long click on
the item to open the resource file.
The PDF viewer included in TeXpert provides SyncTeX technology to jump
back to the position in the source document that generates the particular
content in PDF file. To do that, long tap at a position in PDF file.
/storage/emulated/0/
in the file explorer.
The symbolic link /sdcard
in Android actually points to /storage/emulated/legacy/
.
TeXpert provides two mechanisms to assist you in your writing.
Note: One must check the option in Settings to enable this feature.
Tab
to expand the token at the cursor based on your defined
expansion pattern. This feature is borrowed from TeXworks. Open Settings
from action panel, click on Manage expansion pattern
and then
Add expansion pattern
to open dialog to add patterns.
See this document
for more details. Note that unlike TeXworks, we do not support bullet character. But
you can add an #INS#
in its place and use Ctrl+I
to cycle
through the #INS#
and replace them.
Settings
Combination | Action |
---|---|
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 fullscreen. Then jump to the PDF position corresponding to the code location at the editor's cursor. |
Combination | Action |
---|---|
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 |
All screenshots here are for tablets. Phone is not officially supported although TeXpert also works well on them. Also, these screenshots are captured for full version. As a result, some are not applicable to Lite version.
Ctrl+B
to do BibTeX`
, single quote '
, tilde ~
keysCtrl+J
or Edit (pencil icon) > Jump to PDF in toolbar
- Note: SyncTeX can only jump to the "correct" line so break lines frequently
- Usage note: For this to work, make sure to open your document under /storage/emulated/0/
. The symbolic link /sdcard
in Android actually points to /storage/emulated/legacy/
.
\input
-ed document has no \section, \subsection,
etc.\input, \bibliography
\input, \includegraphics,
etc.
- When click, outline of referenced source code will also be incorporated into master document's outline
- Long click to open included file
#INS#
point; Alt+Tab
on physical keyboard is handled by Android to show recent apps..
to go to parent folder to save the up button#INS#
in expansion patterns: use Alt+Tab
to go to next insertion point.
F1
to compile with primary engine (pdfLaTeX) and
F2
to compile with secondary engine (BibTeX).
$, ^, ...
to set of pattern delimiters
{
and
[
to insert closing ones
}
and
]
Combination | Action |
---|---|
Ctrl+O | Open |
Ctrl+S | Save current document |
Ctrl+T | Compile main document |
Combination | Action |
---|---|
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 |
Shift+Arrow keys | Select block for copy/paste/comment |
\input
tree; Expand item on click; Do not download resource if it already
exists; Prevent edit loss due to reload; Nicer view with connecting
lines. Warning: App might crash in case of
circular inclusion!
\input
or
\include
, images in
\includegraphics
and bibliography database in
\bibliography
) before compilation. Note that recursive inclusion (
\input
within included files) is not yet supported!
LAHpdf is an interactive program to get information about PDF document and render PDF pages to PNG images.
LAHpdf is used in TeXpert to render PDF document for two important reasons. First, it is executed in separate process and thus, if it crashes, TeXpert does not crash. Second, it allows TeXpert to have its source code private because there is no linking: there is thus no violation of MuPDF AGPL v3.0 license as long as LAHpdf is open source and licensed under the same AGPL v3.0.
Remark: On Android 5.0 Lollipop, we use Android PDFRenderer
API to render PDF.
Execute
lahpdf path_to_pdf
to start interaction. At the moment, the following commands are
supported:
exit
: (evidently) exit the program;
info
: print number of pages and (common) width and height of all pages
assuming default resolution of 72dpi; and
%d %f %d %d %d %d
: render a rectangular region of a page. For this rendering
command, the first number is the index of the page to render (count
from 0), the second is the zoom factor, the remaining are for
coordinates of left-top corner followed by the width and height of
the target region. The bitmap (in PNG format) is dumped to standard
output stream.
The source code is included below and is licensed under GNU Affero Public License (AGPL) v3.0 . For compilation instructions, please consult MuPDF documentation.
/* Copyright © by L.A.H. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <mupdf/fitz.h> #define VERSION "1" int main(int argc, char **argv) { if (argc == 0) { printf(VERSION); return 0; } char *filename = argv[1]; fz_context *ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED); fz_output *out = fz_new_output_with_file(ctx, stdout); fz_document *doc = fz_open_document(ctx, filename); fz_colorspace *colorspace = fz_device_rgb(ctx); char cmd[1024]; int pagenumber, px, py, pw, ph, old_pgnum, old_pw, old_ph; fz_page *page = NULL; fz_pixmap *pix = NULL; float zoom; old_pgnum = 0; old_pw = old_ph = -1; while (gets(cmd)) { if (!strcmp(cmd, "exit")) break; // Process info command if (!strcmp(cmd, "info")) { int pagecount = fz_count_pages(doc); if (page == NULL) page = fz_load_page(doc, 0); fz_rect bounds; fz_bound_page(doc, page, &bounds); printf("%d %f %f\n", pagecount, bounds.x1 - bounds.x0, bounds.y1 - bounds.y0); fflush(stdout); continue; } sscanf(cmd, "%d %f %d %d %d %d", &pagenumber, &zoom, &px, &py, &pw, &ph); // Load page if necessary if (pagenumber != old_pgnum) { if (page != NULL) fz_free_page(doc, page); page = fz_load_page(doc, pagenumber); old_pgnum = pagenumber; } // Make new the pixmap if necessary if (pix == NULL || pw != old_pw || ph != old_ph) { if (pix != NULL) fz_drop_pixmap(ctx, pix); pix = fz_new_pixmap(ctx, colorspace, pw, ph); old_pw = pw; old_ph = ph; } fz_clear_pixmap_with_value(ctx, pix, 0xff); pix->x = px; pix->y = py; fz_matrix transform = fz_identity; fz_pre_scale(&transform, zoom, zoom); fz_device *dev = fz_new_draw_device(ctx, pix); fz_run_page(doc, page, dev, &transform, NULL); fz_output_png(out, pix, 0); fflush(stdout); fz_free_device(dev); } if (pix != NULL) fz_drop_pixmap(ctx, pix); if (page != NULL) fz_free_page(doc, page); fz_close_output(out); fz_close_document(doc); fz_free_context(ctx); return 0; }