🎓 Write a thesis chapter, start to finish¶
Status: tutorial.
Written for a doctoral or master's student who wants a chapter of their own thesis drafted from their own library, and who has not used this pipeline before. Assumed: nothing. This page deliberately repeats what other documents also say, so that you can finish a chapter without leaving it. Not covered here: how retrieval ranks (RETRIEVAL.md) and why each prose rule exists (WRITING-STANDARDS.md).
Sister tutorials: a survey, a textbook chapter, a tutorial, a deep-research report.
🧭 Table of contents¶
- What makes this genre different
- What you will have at the end
- Before you start
- Step 1: the research question, the examiner, the slug
- Step 2: open the dossier
- Step 3: write an outline (optional, recommended)
- Step 4: ask for the chapter
- Step 5: gate, render, sidecar
- Step 6: put it in your thesis
- Step 7: read the review aids
- Step 8: change something
- When something goes wrong
⚖ What makes this genre different¶
The output is a LaTeX fragment, not a document: no
\documentclass, no \begin{document}, no preamble. It is written to be
\input into the thesis you already have, so your own template,
numbering and bibliography stay in charge.
This has three deliberate consequences:
- Citations are
\citep{...}/\citet{...}, not[@citekey]. The gate reads both, so the guarantee is unchanged. - The fragment carries no References section. Your thesis has one thesis-wide bibliography, and a second one landing mid-chapter would compete with it.
- Figures are inline
\inputs inside a hand-writtenfigurefloat, because the fragment has to stay self-contained once it leaves this pipeline. The skill hands each figure it decides on tofigure-drawer, which draws the TikZ file and its ASCII twin (FIGURE-DRAWER.md).
🎯 What you will have at the end¶
For a chapter you decide to call thesis/methods:
| Path | What it is |
|---|---|
content/drafts/thesis/methods.tex |
the fragment: the canonical copy, the thing you \input |
content/dossiers/thesis/methods/ |
scope, kept evidence, rejected candidates, every search run |
content/rendered/thesis/methods.pdf |
a standalone preview, so you can read it before it is in the thesis |
content/rendered/thesis/methods.md |
a Markdown preview of the same |
content/rendered/thesis/methods.evidence.pdf |
the evidence sidecar: each cited source with the spans that justified it |
🔧 Before you start¶
Three things, once per machine.
1. Install it and get a project directory. Either
1 2 3 | |
or clone the repository and cp config.toml.example config.toml.
2. Export your library to BibTeX, at papers/bibliography.bib, with
the PDF file paths attached:
1 2 | |
3. Build the corpus:
1 2 | |
If nothing is parsed, your export has no usable PDF paths. Fix that
first, because a chapter cannot be grounded in a corpus with no text in
it.
Every command here also works as
python -m chitragupta.<layer> ....
🔬 Step 1: the research question, the examiner, the slug¶
The research question is the one thing this genre will not proceed sensibly without. A thesis chapter argues toward an RQ instead of summarising papers in sequence. Write it down in one sentence, e.g. "RQ2: under what conditions does a reduced-order surrogate remain faithful enough to support a safety decision?"
The examiner is your reader. Name what they already know, so background is recapped where it is needed and nowhere else. "An examiner in control engineering who has never worked with digital twins" produces a very different chapter from "an examiner who supervises three digital-twin students".
The slug is the path under content/drafts/, without the suffix:
| You are writing | Use |
|---|---|
| the methods chapter of one thesis | thesis/methods |
| a chapter that shares a topic with other genres | dt/thesis-chapter |
| a standalone chapter | methods |
🗂 Step 2: open the dossier¶
1 2 | |
Note the .tex suffix: this genre's draft is LaTeX.
That writes eight files. Exactly one is yours to fill in: scope.md.
The rest (evidence.md, rejected.md, sections.md, retrieval.md,
steering.md, revisions.md, README.md) are written for you as the
chapter is produced.
What goes in scope.md¶
init writes it with every heading present and empty. Five things are
yours:
| Field | What goes in it | Why it is asked for |
|---|---|---|
- language: |
a BCP-47 tag: en-GB, en-US, en-IN |
ships unset; your institution decides it, and an unset one silently gets the model's own |
## Reader |
the examiner, in one sentence, including what they have just read | background gets recapped where it is needed and nowhere else |
## Covers |
the RQ this chapter serves, and nothing beyond it | keeps the chapter from absorbing the next one |
## Does not cover |
what belongs to other chapters, and any theme the corpus could not support | an examiner reads an unexplained absence as an oversight |
## Glossary |
each recurring term with its one pinned definition | the field that matters most in this genre: an examiner notices terminology drift, and this is what a later revision is held to |
Set the dialect with the command, so the format is right:
1 | |
A filled-in thesis-chapter scope.md follows; the whole file is at
examples/dossiers/thesis-chapter/scope.md:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
The two glossary entries that say "pinned here because the sources use it differently" let a chapter keep its own vocabulary while citing papers that do not share it.
🗺 Step 3: write an outline (optional, recommended)¶
For a chapter arguing toward an RQ, declaring the arc yourself is usually better than letting it be inferred:
1 2 | |
Look at what the corpus holds before you commit to sections:
1 | |
Then edit content/dossiers/thesis/methods/outline.md. Three fields per
section:
| Field | What goes in it | What the skill does with it |
|---|---|---|
brief: |
steering in your own words | consumed once, never appears in the chapter |
claim: |
your own prose: the argument you intend to make | rewritten and grounded; any sentence the corpus cannot support is reported back rather than shipped |
queries: |
a - list of search terms |
run verbatim instead of the skill inventing sub-themes |
A section needs at least a brief: or a claim:; queries: is optional
even then. Sections may nest (### under ##), which this genre uses
more than the others, because a chapter's technical core usually has two
or three families to treat separately.
This genre gets the most out of claim:. A thesis chapter argues, and
writing your intended argument as claim: blocks means the skill either
grounds each one or tells you it cannot, before an examiner finds the
gap.
A worked example follows; the whole file is at
examples/dossiers/thesis-chapter/outline.md:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
Validate it:
1 | |
🗣 Step 4: ask for the chapter¶
Ask in ordinary words, in a session in this project directory:
Draft the methods chapter of my thesis into
content/drafts/thesis/methods.tex. RQ2 is: under what conditions does a reduced-order surrogate remain faithful enough to support a safety decision? The dossier and outline are there.
"Thesis chapter", "dissertation section" or "RQ-driven chapter" is what
selects thesis-chapter-writer. Give it the RQ in the same message,
because the RQ is the spine of everything it writes.
What it then does: clarifies the RQ if you did not give one, retrieves
broadly and filters, re-searches thin concepts, checks for disagreement
between kept sources, drafts the fragment with \citep/\citet, records
provenance, and maps each section to the citekeys it cites. It never
writes a citekey it did not get from a retrieval result.
✅ Step 5: gate, render, sidecar¶
The skill runs these. Run them yourself after any hand edit.
1 | |
OK means every \citep{...} key is real. FAIL names the line; fix
the key or drop the claim.
Previews are for reading; the fragment stays canonical:
1 2 | |
This genre should always emit the evidence sidecar. Your reader is an examiner reading adversarially for the claim that outruns its evidence, and the sidecar is what lets them check one:
1 | |
It is a separate standalone document, never something your thesis
\inputs.
Then stamp it, so a later drift report knows what it is comparing against:
1 | |
📎 Step 6: put it in your thesis¶
Copy or symlink the fragment into your thesis tree and \input it:
1 2 | |
Three things your thesis preamble must provide, because a fragment carries no preamble of its own:
natbibor whatever supplies\citep/\citet. You almost certainly have this already.- Every citekey the chapter cites, in your thesis
.bib. They came from your own export, so this is normally already true. \usepackage{tikz}and the TikZ libraries any figure needs, if the chapter has figures. Each figure file names its libraries in a\usetikzlibraryline at the top; put those names in your preamble too.
The chapter writes no \renewcommand{\thefigure} and no hand-typed
figure numbers, so your thesis numbers everything consistently.
🔍 Step 7: read the review aids¶
None of these can block anything; all exit 0. --write files a report
under content/review/thesis/ for the agenda below to read;
provenance files its report on every run and has no --write.
1 2 3 4 5 6 | |
For a thesis chapter, three are worth more than the rest:
review verbatim. Reuse of a source's wording is the failure with consequences at a viva. It reports wording shared with any parsed source, cited or not, in three buckets:long,shortandquoted(the last being an attributed quotation, which is legitimate).review support. It checks whether each citation entails the claim it is attached to, which mechanises the examiner's own reading habit.review quotation. It checks that each quoted span matches the source it cites, word for word.
If the chapter has TikZ figures, also:
1 | |
The agenda: all of them as one worklist¶
1 | |
The agenda merges the reports the aids above filed into one ranked
worklist. It never runs an aid itself, and it names any aid whose report
is absent. AGENDA.md explains every section of the file;
WRITE-A-SURVEY.md's step 7
covers the [unattended]/[surfaced] classes, --baseline and
--accept. What follows is the part specific to a thesis chapter.
For the methods chapter we have been building, the report reads like this (the fixed "How to read this" paragraph is left out):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
Reading that as the author: the misquoted item is the one to fix
first. A quotation that says "bound" where the source said "estimate" is
the error this chapter's own glossary exists to prevent, and an examiner who
spots it will doubt the rest. The two unsupported-claim items are the
sentences where your argument outruns your sources: either soften them,
or find the source that carries them.
The uncited-claim in the closing section is a claim you have made on
your own authority in a place the chapter said it would not.
The [unattended] verbatim runs can be handed off: ask to "work the
review agenda" and agenda-reviser repairs them one at a time, re-running
the gate after each and logging every attempt in revisions.md.
📝 Step 8: change something¶
Never re-run the genre skill to make a change. Ask for a revision:
The examiner will not accept the claim in section 2 without a bound. Soften it and cite whatever in the corpus actually states one.
That selects draft-reviser, which reads the dossier, edits only what is
affected, and logs it in revisions.md.
After any hand edit of your own:
1 2 | |
Back it up, since content/drafts/ is gitignored:
1 | |
🚑 When something goes wrong¶
| What you see | What it means | What to do |
|---|---|---|
| The skill refuses, saying the ledger is empty | no corpus | chitragupta corpus sync |
gate says FAIL |
a \citep key is not in the corpus |
correct it or drop the claim; never add it by hand |
| The preview PDF fails on a figure | the figure's TikZ does not compile | ask to fix the figure, which figure-drawer handles; a broken figure fails the whole render |
Your thesis build fails on \citep |
no natbib in your preamble |
add it; the fragment cannot |
Your thesis build fails on of in a node position |
the TikZ library is not loaded in your preamble | add \usetikzlibrary{...} with the names the figure file lists |
| The chapter reads like a summary, not an argument | the RQ was never stated | give the RQ and ask draft-reviser to re-frame around it |
| A cited paper left your library | the corpus moved | chitragupta draft dossier status --all, then ask for a re-grounding pass, which draft-reviser runs |