How to work on LaTeX with AwanBox
Write your thesis in LaTeX without fighting the installation. An agent sets up a small TeX install, builds a thesis you can start from, and shows what the common errors mean. This post follows a real run.
LaTeX is how many final-year theses are typeset. The maths looks right, the references and the contents page build themselves, and your supervisor may ask for it. The hard part is the start: a full install is several gigabytes, and the first error message can be a page of strange text.
On awx the install happens on a computer that is not your laptop, and you collect the PDF from the Files tab. We asked an agent to set it up on a Small computer, make a starter thesis and break it on purpose. The agent got a few things wrong on the way, and those are in here too.
The first message
I am a final-year student and I want to write my thesis in
LaTeX, but I do not want to fight the installation. Please set it
up on this computer. First tell me how much free disk space there
is, then install only what a normal thesis needs (not the full
multi-gigabyte TeX Live), and tell me how big the install was and
how long it took. Then, in /home/agent/thesis, make a small thesis
I can build on: a title page, an abstract, a table of contents,
two chapters, one table, one figure (draw it with TikZ so no image
file is needed), and a bibliography with three real references in
references.bib that are cited in the text. Compile it to
thesis.pdf with latexmk and tell me the page count and the file
size. Then break it on purpose in two typical ways (a missing
closing brace, and a citation key that does not exist), show me
what the error message looks like and how you find the real cause
in the log, and fix both. Finally list the commands I would type
to rebuild the PDF myself, and anything that did not work on the
first try.
Two parts of this message do the work. "Not the full multi-gigabyte TeX Live" stops the agent installing everything. "Anything that did not work on the first try" makes it list its own mistakes.
What it installed
- The pieces: the LaTeX core, the recommended packages (which include
hyperrefandnatbib), the TikZ drawing package,latexmk, which reruns LaTeX and BibTeX as often as needed, and thelmodernfonts. - The size: about 240 MB on disk. When we looked ourselves,
/usr/share/texlivewas 155 MB,/usr/share/texmf45 MB and the generated format files in/var/lib/texmf42 MB. - The time: a couple of minutes. The first install command ran past the 85-second limit for a single step and was cut off in the middle. The agent finished it with
sudo dpkg --configure -ain the background. The agent said most of the wait is TeX building its font maps and format files, not downloading. - Your storage counts it. The agent first reported the free space of the machine's disk, which is not your allowance. The plans give you 5 GiB of files across all your computers, and nothing is deleted if you go over but you cannot add more. Our test account went from 1.1 to 1.4 GiB on this computer and showed 4.7 of 5.0 GiB, marked "Nearly full". Check the Usage page before you install, and delete what you no longer need.
The thesis it made
The agent wrote six files in /home/agent/thesis:
thesis.tex packages, title page, abstract, contents
chapters/chapter1.tex Introduction
chapters/chapter2.tex Data and Methods: a table, a TikZ figure, two equations
references.bib three references on principal component analysis
.latexmkrc tells latexmk to use pdflatex and BibTeX
README.md a short cheat sheet
The thesis is 11 pages and 226,252 bytes, and latexmk rebuilt it in about four seconds. The figure is a bar chart drawn in TikZ, so there is no image file to lose.
All of the content is placeholder. The university, the student, the sensor network and every number in the table are invented. The three references are real papers (Pearson 1901, Hotelling 1933, Jolliffe and Cadima 2016). Check each reference entry against the source before you reuse it, because a model can get a year or a page number wrong.
Error 1: a missing brace
The agent removed one closing brace from a bold phrase in chapter 1 and built again. LaTeX stopped:
The line number in the message points at thesis.tex, which has nothing wrong with it. That is only where LaTeX ran out of file. The useful part is the "Runaway argument?" line above the error, which quotes the first words of the broken text. The agent searched the chapters for those words, found the line, and counted one opening brace and no closing one.
The rule to keep: "Runaway argument" followed by "File ended while scanning" means a brace was never closed. Ignore the line number and search for the quoted text.
Error 2: a citation that does not exist
The agent then misspelled a citation key, writing one l where the key has two. This time the build did not stop:
latexmk finished with exit code 0 and made a PDF. The only sign in the PDF is a bare ? where the citation should be, for example "given by ?." That is easy to miss in a long document. The messages are in thesis.log (which says the page and line) and in thesis.blg, the BibTeX log, which says it found no entry with that key. Listing the keys with grep "^@" references.bib shows the right spelling.
Before your final submission, search the PDF for ? and [?], and look at the last lines latexmk prints. It says how many citations it could not resolve.
We checked it
We opened a terminal on the computer and looked at the result ourselves:
The page count and file size matched what the agent said, the fonts are embedded vector fonts, the log has no undefined references, and latexmk says everything is up to date. We did not read the thesis text itself closely, so that is the part we did not check.
What went wrong on the way
The agent listed these without being asked twice. They are the kind of thing that costs an evening on a laptop:
- The first fonts were blurry. A test page came out with Type 3 bitmap fonts, which look fuzzy on screen and cannot be searched or copied. The
lmodernpackage fixed that, which is why it is on the list above. - A maths symbol was undefined.
\mathbbneeds theamssymbpackage. The agent added it, withamsmath. - The TikZ figure was wrong twice. The cumulative line had a different vertical scale from the bars, and three labels overlapped. The agent turned the page into a picture, looked at it, and fixed both. A PDF can build without errors and still look wrong.
- It could not look at its pictures at first. Chrome needs
--no-sandboxon these computers and then drew nothing, so it installed a small image viewer instead. This only affected how it checked its work. - It killed its own build. Piping the compiler output through
headclosed the pipe early and stopped the compile, and the first error test showed no error. It ran the build again without the pipe.
It also noticed that page 6 of the PDF holds only one short section. That is ordinary LaTeX page breaking and it changes when you add text.
Rebuilding it yourself
cd /home/agent/thesis
latexmk -pdf thesis.tex # build after any edit
latexmk -pdf -pvc thesis.tex # rebuild each time you save
latexmk -c # delete helper files, keep the PDF
latexmk -C # delete helper files and the PDF
If a build gets confused, run latexmk -C and then the build again. To get the PDF, open the Files tab, go to thesis and press Download beside thesis.pdf.
Your .tex and .bib files are plain text and small. Keep them in Git or on your own drive too, and read the backup post for how to save a copy outside the computer.
When Overleaf is the better choice
Overleaf is a website made for this, and it is the better choice in several cases:
- You want a live preview as you type, and a supervisor who can comment inside the document.
- Your university gives you a template in Overleaf. Some do.
- You never want to see a terminal.
A computer on awx suits you if you like working from files and a terminal, if your figures come from scripts that the same computer can run before the build (as in the survey post), or if you want to ask an agent to explain a log. It is also a way to learn what LaTeX is doing. Ask your supervisor which format they expect before you choose.
What it cost
The agent run was 71 steps over about 13 minutes on a Small computer, which is RM0.03 an hour while it runs. That came to around a sen of the welcome credit. One run is limited to 80 steps, so this one used most of its allowance, and a longer job is better split into two messages. The larger cost is storage, about 0.3 GiB of your allowance. How running time and credit work has the details.
Cautions
- Use your university's template. The starter thesis is only a base. Departments have rules for margins, fonts and the title page.
- Check every reference and every number the agent wrote. In this run all of the content was made up on purpose.
- Check your course rules on AI help with a thesis, and say in your methods what the agent did.
- Keep your own copy of the source files.
awxis in early alpha.
Keep reading
- How to clean and analyse a survey CSV with pandas
- How to back up and restore a cloud computer: a tested guide
- Your final-year project shouldn't live on your laptop
Getting started
Sign in with your Google account and open a chat on a Small computer. Paste the first message from this post, then replace the placeholder text with your own and your university's template.
Awi, signing off.