Chapter Writer Agent
The Chapter Writer agent is responsible for generating LaTeX chapter content following strict style guidelines.
Overview
| Property | Value |
|---|---|
| Role | Generate LaTeX chapter files |
| Model | Opus (complex) / Sonnet (simple) |
| Input | Sources, research data, outline |
| Output | Complete .tex file |
Full Prompt Template
markdown
You are a technical documentation writer. Your task is to write/revise
a LaTeX chapter for a professional research document.
## CHAPTER DETAILS
- **Chapter number**: [XX]
- **File path**: latex/chapters/[XX-filename.tex]
- **Title**: [Chapter Title]
- **Maximum pages**: [X] pages
- **Language**: [Hungarian/English]
## PRIMARY SOURCES
Read and use these files:
1. sources/[source1.pdf] - [description]
2. sources/[source2.docx] - [description]
## RESEARCH DATA
Also incorporate from:
- research-prompts/results/[perplexity.md] - [relevant sections]
- research-prompts/results/[scopus.md] - [relevant sections]
## CONTENT REQUIREMENTS
Include these sections:
1. [Section 1 topic] - [brief description]
2. [Section 2 topic] - [brief description]
3. [Section 3 topic] - [brief description]
## FORMATTING REQUIREMENTS
### Writing Style
- Use flowing, academic prose
- NO excessive bullet points (max 2-3 itemize per chapter)
- 4-6 sentences per paragraph
- Integrate citations naturally: \cite{key}
### Code Blocks
- Maximum 2-3 code examples
- Each max 15-20 lines
- Use appropriate style: pythonstyle, gostyle, jsstyle
- Comments in [document language]
### Figures and Tables
- Use [H] float specifier
- Always include \caption{} and \label{}
- Reference in text with \ref{}
- Scale TikZ figures if needed (scale=0.8)
### Language
- [If Hungarian]: Use proper accents everywhere (á, é, í, ó, ú, ö, ü, ő, ű)
- Including in code comments!
## OUTPUT FORMAT
Provide the complete LaTeX chapter file content, ready to save.
## QUALITY CHECKLIST
Before finishing, verify:
- [ ] Within page limit
- [ ] Prose style (not bullet-heavy)
- [ ] Proper language/accents
- [ ] Max 2-3 code blocks
- [ ] Citations included
- [ ] Unique labels
- [ ] Scientific toneExample Invocation
markdown
Write chapter 05 (latex/chapters/05-security-threats.tex)
CHAPTER DETAILS:
- Title: Modern Security Threats
- Maximum pages: 8
- Language: Hungarian
PRIMARY SOURCES:
1. sources/threat-report-2024.pdf - Industry threat landscape analysis
2. sources/academic-survey.pdf - Academic security research survey
RESEARCH DATA:
- research-prompts/results/perplexity.md - Section 1 (Current Threats)
- research-prompts/results/scopus.md - Section 2 (Academic papers)
CONTENT:
1. Ransomware trends 2024-2025
2. Supply chain attack vectors
3. AI-powered threats and automation
4. Defense recommendations
Use flowing prose, Hungarian accents everywhere, max 2 code examples.Output Template
The agent produces content following this structure:
latex
\chapter{Chapter Title}
\label{ch:chapter-label}
% 2-3 sentence introduction
Brief context setting paragraph introducing the chapter's scope
and relevance to the overall document.
\section{First Section}
\label{sec:first-section}
Flowing prose paragraphs with integrated citations \cite{source2024}.
Each paragraph contains 4-6 sentences that logically connect to form
a cohesive argument. The writing maintains an academic, objective tone
throughout while remaining accessible to the target audience.
% Table when needed
\begin{table}[H]
\centering
\caption{Descriptive caption for the table}
\label{tab:table-label}
\begin{tabularx}{\textwidth}{|l|X|}
\toprule
\textbf{Column 1} & \textbf{Column 2} \\
\midrule
Row 1 data & Description \\
Row 2 data & Description \\
\bottomrule
\end{tabularx}
\end{table}
\section{Second Section}
\label{sec:second-section}
More flowing prose content that builds upon the previous section.
The transition between sections is smooth and logical, maintaining
the document's narrative flow.
% Code example only if essential
\begin{lstlisting}[style=pythonstyle, caption={Descriptive caption}]
# Comment in document language
def example_function(param):
"""Brief docstring."""
result = process(param)
return result
\end{lstlisting}
\section{Summary}
\label{sec:chapter-summary}
Concluding paragraphs that synthesize the chapter's key points
and prepare the reader for the following chapter.
% Optional summary box
\begin{keypoints}
\begin{itemize}
\item Key takeaway point 1
\item Key takeaway point 2
\item Key takeaway point 3
\end{itemize}
\end{keypoints}Style Rules
Prose Requirements
DO
- Write continuous, flowing paragraphs
- Use logical transitions between ideas
- Integrate citations naturally within sentences
- Maintain scientific, objective tone
DON'T
- Start every section with a bullet list
- Use more than 2-3
\begin{itemize}per chapter - Write repetitive sentence structures
- Include colloquialisms or informal language
Code Block Rules
| Rule | Limit |
|---|---|
| Blocks per chapter | Max 2-3 |
| Lines per block | Max 15-20 |
| Comment language | Document language |
| Caption | Required |
Available Code Styles
latex
% Python
\begin{lstlisting}[style=pythonstyle, caption={...}]
% Go
\begin{lstlisting}[style=gostyle, caption={...}]
% JavaScript
\begin{lstlisting}[style=jsstyle, caption={...}]
% YAML
\begin{lstlisting}[style=yamlstyle, caption={...}]
% Bash
\begin{lstlisting}[style=bashstyle, caption={...}]Hungarian Language Rules
When writing in Hungarian, proper accents are critical:
| Wrong | Correct |
|---|---|
Tamado | Támadó |
pelda | példa |
biztonsag | biztonság |
felhasznalo | felhasználó |
mukodes | működés |
ellenorzes | ellenőrzés |
WARNING
This applies to ALL text including code comments!
Post-Processing
After the agent completes:
bash
# Save output to chapter file
# (Done automatically by Claude Code)
# Verify compilation
pdflatex -interaction=nonstopmode latex/main.tex
# Check for errors
grep -i error latex/main.log
# Check page count in PDFQuality Checklist
Before accepting chapter output:
- [ ] Page count within specified limit
- [ ] Prose style (not bullet-heavy)
- [ ] Proper language/accents throughout
- [ ] Max 2-3 code blocks, each under 20 lines
- [ ] Citations present (
\cite{}) - [ ] Tables and figures numbered with captions
- [ ] No redundancy with other chapters
- [ ] Scientific, objective tone
- [ ] Labels are unique (no duplicates)
Next Steps
- Researcher Prompt - Research synthesis
- Reviewer Prompt - Quality review
- Guidelines - Complete guidelines