LaTeX Sentence-Per-Line
Keep prose-oriented LaTeX files in one-sentence-per-line format after writing edits.
Overview
This skill makes sentence-per-line formatting a required finishing step for LaTeX writing work. It is for prose-heavy .tex files, not for bibliography files, style files, or TeX fragments dominated by equations, macros, or tables.
When to Use
Use this skill when the user asks to:
- write or revise a LaTeX section,
- polish thesis or paper prose in
.tex files,
- edit introduction, method, experiments, discussion, or conclusion text,
- keep LaTeX prose in one-sentence-per-line style,
- normalize sentence-per-line formatting after content edits.
Do not use this skill for:
.bib, .sty, or .cls files,
- generated files,
- table-heavy, macro-heavy, or equation-heavy TeX fragments,
- tasks that are not editing prose.
Default Workflow
- Identify which touched files are prose-oriented
.tex files.
- Make the requested writing edits first.
- Run the bundled formatter on the touched prose files:
python3 scripts/apply_sentence_per_line.py path/to/file.tex
For multiple files:
python3 scripts/apply_sentence_per_line.py path/to/intro.tex path/to/conclusion.tex
- Review the resulting diff.
- Repair edge cases manually if abbreviations, citations, math-adjacent prose, or command-heavy sentences were split awkwardly.
- Only then report the task complete.
Safety Rules
- Preserve LaTeX structure and commands.
- Do not run the formatter on non-prose files just because they end in
.tex.
- Do not claim completion before the formatter step for qualifying prose edits.
- LaTeX comments beginning with
% are formatter-excluded and should remain untouched.
- If the script creates suspicious breaks, fix those lines manually instead of skipping review.
Quick Reference
| Situation |
Action |
Editing prose in section.tex |
Edit first, then run formatter |
| Editing multiple prose sections |
Run formatter on all touched prose files |
| Editing a macro-heavy file |
Skip formatter unless the edited region is clearly prose-heavy |
| Suspicious output after formatting |
Manually repair affected lines before finishing |
Formatter Behavior
The bundled script inserts a newline after ., !, or ? when the next token begins with an uppercase letter or a LaTeX command. This preserves the existing project behavior instead of broadening scope.
Formatter path:
scripts/apply_sentence_per_line.py
Common Mistakes
- Editing LaTeX prose and forgetting to run the formatter.
- Running the formatter on
.bib, .sty, or .cls files.
- Assuming every
.tex file is prose-oriented.
- Skipping the diff review after formatting.
- Leaving awkward splits around abbreviations or citations uncorrected.
1---2name: latex-sentence-per-line3description: Use when writing, revising, or polishing prose in LaTeX `.tex` files and you want one sentence per line, especially for thesis sections, paper sections, manuscript prose, or any workflow where edited LaTeX prose should be normalized before completion.4---56# LaTeX Sentence-Per-Line78Keep prose-oriented LaTeX files in one-sentence-per-line format after writing edits.910## Overview1112This skill makes sentence-per-line formatting a required finishing step for LaTeX writing work. It is for prose-heavy `.tex` files, not for bibliography files, style files, or TeX fragments dominated by equations, macros, or tables.1314## When to Use1516Use this skill when the user asks to:1718- write or revise a LaTeX section,19- polish thesis or paper prose in `.tex` files,20- edit introduction, method, experiments, discussion, or conclusion text,21- keep LaTeX prose in one-sentence-per-line style,22- normalize sentence-per-line formatting after content edits.2324Do not use this skill for:2526- `.bib`, `.sty`, or `.cls` files,27- generated files,28- table-heavy, macro-heavy, or equation-heavy TeX fragments,29- tasks that are not editing prose.3031## Default Workflow32331. Identify which touched files are prose-oriented `.tex` files.342. Make the requested writing edits first.353. Run the bundled formatter on the touched prose files:3637```bash38python3 scripts/apply_sentence_per_line.py path/to/file.tex39```4041For multiple files:4243```bash44python3 scripts/apply_sentence_per_line.py path/to/intro.tex path/to/conclusion.tex45```46474. Review the resulting diff.485. Repair edge cases manually if abbreviations, citations, math-adjacent prose, or command-heavy sentences were split awkwardly.496. Only then report the task complete.5051## Safety Rules5253- Preserve LaTeX structure and commands.54- Do not run the formatter on non-prose files just because they end in `.tex`.55- Do not claim completion before the formatter step for qualifying prose edits.56- LaTeX comments beginning with `%` are formatter-excluded and should remain untouched.57- If the script creates suspicious breaks, fix those lines manually instead of skipping review.5859## Quick Reference6061| Situation | Action |62|---|---|63| Editing prose in `section.tex` | Edit first, then run formatter |64| Editing multiple prose sections | Run formatter on all touched prose files |65| Editing a macro-heavy file | Skip formatter unless the edited region is clearly prose-heavy |66| Suspicious output after formatting | Manually repair affected lines before finishing |6768## Formatter Behavior6970The bundled script inserts a newline after `.`, `!`, or `?` when the next token begins with an uppercase letter or a LaTeX command. This preserves the existing project behavior instead of broadening scope.7172Formatter path:7374```text75scripts/apply_sentence_per_line.py76```7778## Common Mistakes7980- Editing LaTeX prose and forgetting to run the formatter.81- Running the formatter on `.bib`, `.sty`, or `.cls` files.82- Assuming every `.tex` file is prose-oriented.83- Skipping the diff review after formatting.84- Leaving awkward splits around abbreviations or citations uncorrected.