LaTeX to PDF on Android: Convert .tex Files on Your Phone
By Laxmi SolutionsUpdated 4 min read
Someone sends you a .tex file, or you have a LaTeX project in a folder on your phone, and you need the PDF now. Online LaTeX-to-PDF converters work, but they mean uploading your document and waiting on a queue. This guide shows how to compile a .tex file to PDF on the phone itself with Lemma, including multi-file projects, bibliographies and the errors you are most likely to meet.
Online converter or on-device compiler?
A web converter takes your .tex file, compiles it on a server and sends a PDF back. That is fine for a one-off, but every edit means another upload, images and .bib files have to be bundled, and a thesis draft or a signed letter leaves your hands. An on-device compiler keeps the loop short: edit, compile, read, repeat, with nothing uploaded and no connection required after the first run.
| Online converter | Lemma (on-device) | |
|---|---|---|
| Needs a connection | Every compile | First compile of a new package only |
| Multi-file projects | Zip and re-upload each time | Open the folder; files stay in place |
| Privacy | Document sent to a server | Never leaves the phone |
| Edit and re-compile | Repeat the upload | Tap Compile, or compile on save |
| Error messages | Often a raw log | Listed with line numbers; tap to jump |
Open the .tex file
- Install Lemma from Google Play (free, no account). The offline compiler, about 13 MB, downloads once.
- From your file manager, email or chat app, open the .tex file with Lemma. It opens straight into the editor.
- For a project with several files, choose New project → Import folder and pick the folder, or import the .zip export from Overleaf or any other editor.
- A project on GitHub or GitLab can be cloned directly: New project → Git repository, paste the URL.
In a multi-file project Lemma picks the main file by looking for \documentclass. If it guesses wrong, long-press the right file's tab in the editor and choose Set as main file.
Compile to PDF
Tap Compile. The first time a document uses a package, Lemma downloads it (once) and shows the progress; after that the compile runs offline. The PDF appears below the source on a phone and beside it on a tablet. Sync scroll keeps the two aligned, and tapping a spot in the PDF jumps to the line that produced it.
Lemma compiles with Tectonic, a XeTeX-based engine, so Unicode input and fontspec work out of the box. Most documents written for pdfLaTeX compile unchanged; the exceptions are covered in pdfLaTeX vs XeLaTeX vs LuaLaTeX.
\documentclass[11pt]{article}
\usepackage{geometry}
\geometry{a4paper, margin=2.5cm}
\usepackage{graphicx}
\begin{document}
\section*{Field report}
Compiled on a phone, no server involved.
\includegraphics[width=\linewidth]{figure.png}
\end{document}Images referenced with \includegraphics must be inside the project folder (or a subfolder). An image in your Downloads folder is not part of the project; copy it in first.
Bibliographies, citations and multiple passes
Lemma runs as many passes as the document needs, so cross-references, tables of contents and BibTeX bibliographies resolve in one tap. Put the .bib file in the project and cite as usual:
\bibliographystyle{plain}
\bibliography{references} % references.bib in the projectBiber (used by biblatex with the Biber backend) and makeindex are not available on the device; switch to BibTeX, or compile that one document on a desktop. The trade-offs are in BibTeX vs biblatex.
Fixing a compile that fails
When the compile stops, Lemma lists the errors with their line numbers; tap one to jump to it. The three you will meet most often:
File 'x.sty' not found: a package that does not exist in the TeX distribution, or a typo in\usepackage. Check the name on CTAN.Missing $ inserted: a math symbol such as_,^or\alphaoutside math mode. Wrap it in$…$.Undefined control sequence: a command from a package you have not loaded, or a misspelt command.
A longer list, with the fix for each, is in the most common LaTeX errors.