Sarmate.net Sarmate.net
Home Features Pricing Documentation Contact
Log in Sign up
Workflow 3 min

Write a long document (master & sub-files)

For a thesis or a long paper, you split the document into several files: a master document (with the preamble and \begin{document}) that includes the chapters via \input{…}. On Sarmate, you can edit one chapter and compile the whole document, without switching files.

Where to click

  1. Create a master file (e.g. main.tex) with your preamble, and chapter files included via \input{chapter1}.
  2. Open a chapter and click “Compile”. Since the chapter has no \documentclass, Sarmate opens a dialog.
  3. Pick an option: “Choose a master from the drive”, “Upload a master”, or “Make this file standalone”.
  4. Once the master is set, Sarmate adds a % !TEX root = main.tex line at the top of the chapter. From now on, compiling the chapter compiles the whole master and shows its PDF.
Dialog: set a master document
Change or remove the master later The link is a simple % !TEX root = … line at the top of the file (the TeXstudio/VS Code standard). Edit it to point to another master, or delete it to make the file independent.