Setting Up a Multi-File Project in texspark

texspark was built around one workflow: a project that’s split across many files — a main.tex, a folder of chapters, a .bib somewhere. This guide sets that up from zero. It takes about two minutes.

1. Open your root file

Open the file that holds your \documentclass — the one with the \include or \input lines. For most projects that’s main.tex or manuscript.tex.

That’s genuinely all you open. texspark has no “open folder” step and no project file to create — the root file is the project, because everything else can be discovered from it.

2. Make it the build target

Double-click its tab. (Or press ⌘⇧P.) A 🔨 appears on the tab — that file is now the build target.

This one gesture is the whole setup. From now on:

  • The outline immediately reads the whole \include tree — every chapter in document order, including files you’ve never opened. No build needed.
  • ⌘B builds the root, no matter which file you’re editing. Chapter twelve, the appendix, a figure caption — ⌘B always compiles the right thing.
  • \ref{, \cite{, and SyncTeX all work project-wide: labels from other chapters autocomplete, every .bib the project references is found, and ⌘-clicking the PDF lands in the right sub-file.

3. Work from the outline

Click any section in the outline and the right file opens at the right line — that’s how you move between chapters. There’s no file browser in the sidebar, and after a day you won’t miss it: the outline is a better map of a book than a folder listing ever was.

Sub-files you open this way come up as ordinary tabs. Edit, ⌘B, and the root rebuilds; the PDF stays where you were.

The one rule: start from the root

Order matters once: open the root file first and set it as the target before you wander into chapters.

The reason is honest logic, not a limitation to apologize for: a chapter file doesn’t mention its parent. main.tex says \include{chapters/ch3}; ch3.tex says nothing about main.tex. So if you open a lone chapter first, texspark has no way to know which document it belongs to — no editor does. Start from the root, where the relationships are declared, and everything downstream follows.

(If you arrive in a sub-file through texspark — from the outline or a ⌘-click in the PDF — the parent is already known, and the build target is handled for you.)

A layout that works

texspark doesn’t impose a structure, but if you’re starting fresh, this is a comfortable one:

book/
├── main.tex          ← build target 🔨
├── references.bib
├── chapters/
│   ├── ch1.tex
│   ├── ch2.tex
│   └── ch3.tex
└── figures/

Sub-folders in \include{chapters/ch1} are fine — the outline and SyncTeX follow paths, not just filenames.

That’s the whole setup: open the root, double-click its tab, write. If anything here doesn’t match what you see, email support@texspark.io — it goes straight to the developer.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *