latex-scaffold
Skill150 starsChanged 11 days agoMITView on GitHub
Convert an existing Markdown manuscript draft into a buildable LaTeX project with canonical structure and build configuration. Use when prose already exists but no LaTeX source tree does. Not for checking template drift in an existing project; use $latex-template.
In this repository89 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beamer-deckSkill
- bib-coverageSkill
- bib-filterSkill
- bib-parseSkill
- brief-compliance-checkSkill
- camera-readySkill
- causal-designSkill
- checkpointSkill
- code-archaeologySkill
- compile-knowledgeSkill
- computational-experimentsSkill
- cross-language-checkSkill
- data-analysisSkill
- devils-advocateSkill
- docs-consistencySkill
- docxSkill
- experiment-designSkill
- grill-meSkill
- handoffSkill
- ideasSkill
- init-project-courseSkill
- init-project-lightSkill
- init-project-orchestrationSkill
- init-projectSkill
- insights-deckSkill
- interview-meSkill
- knowledge-lintSkill
- latex-diffSkill
- latex-health-checkSkill
- latex-polishSkill
- latex-postersSkill
- latexSkill
- latex-templateSkill
- lean-checkSkill
- math-proofSkill
- mcp-builderSkill
- method-auditSkill
- multi-perspectiveSkill
- numerical-checkSkill
- pdfSkill
- pipeline-manifestSkill
- playwright-cliSkill
- postmortemSkill
- pre-commit-auditSkill
- pre-submission-reportSkill
- project-deckSkill
- project-safetySkill
- proof-readabilitySkill
- proofreadSkill
- python-envSkill
- quarto-deckSkill
- reorgSkill
- replication-auditSkill
- replication-packageSkill
- retarget-journalSkill
- review-clusterSkill
- review-responseSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Read the Markdown file and inventory:
- Very specific: line 103
After conversion, scan the .tex file for any remaining Markdown syntax:
- Very specific: line 114
If a .bib file exists in the project, point \addbibresource{} to it
- Very specific: line 115
If the project has a references.bib, use that
- Very specific: line 116
If no .bib exists but citations are present, create placeholder comments: % TODO: create .bib with keys: Key1, Key2, ...
- Very specific: line 117
Ensure \printbibliography is at the end of the document (not \bibliography{})
- Very specific: line 121
Run latex to compile. Verify:
- Very specific: line 154
Before writing \cite{key}, verify with paperpile get-item key and paperpile export-bib key.
- Very specific: line 157
If unresolved, write \CiteTodo{slug}{title/author/year/DOI hint} — never a guessed key.
- Very specific: line 160
Run scripts/bib/citation_lint.py before commit.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LaTeX Scaffold
Convert an approved Markdown draft into a minimal, compilable LaTeX project. This is a deterministic format conversion — prose quality should already be addressed in the source draft.
When to Use
- Converting a literature review, survey, or report from Markdown to LaTeX for PDF output
- Turning meeting notes or drafts into a formatted document
- Bootstrapping a LaTeX project from an existing outline
- Any time you need md→tex without rewriting content
Inputs
- A Markdown file (
.md) — the draft to convert - A
.bibfile (optional) — if the draft contains citations
Outputs
- A
.texfile ready to compile withlatex - The fail-closed canonical
.latexmkrcif one does not already exist. Invoke thelatexpre-flight to copy the canonical artifact; never synthesize selected directives.
Workflow
Step 1: Analyse the Draft
Read the Markdown file and inventory:
- Heading structure (determine
\section/\subsectiondepth) - Citations (
[@Key]or[@Key1; @Key2]patterns) - Tables (Markdown pipe tables)
- Math blocks (
$...$inline,$$...$$display) - Figures (
) - Code blocks (fenced with language)
- Whether an abstract section exists
Step 2: Create the LaTeX File
Apply these conversion rules:
| Markdown | LaTeX |
# Title (first H1) | \title{...} |
## Section | \section{...} |
### Subsection | \subsection{...} |
#### Subsubsection | \subsubsection{...} |
## Abstract | \begin{abstract}...\end{abstract} |
Headings starting with Appendix | \appendix once, then \section{...} |
**bold** | \textbf{...} |
*italic* | \emph{...} |
`code` | \texttt{...} |
[@Key] | \citep{Key} |
[@Key1; @Key2] | \citep{Key1,Key2} |
@Key (inline) | \citet{Key} |
$...$ / $$...$$ | Pass through unchanged |
- item | \begin{itemize}\item ...\end{itemize} |
1. item | \begin{enumerate}\item ...\end{enumerate} |
> quote | \begin{quote}...\end{quote} |
 | \begin{figure}[htbp]\includegraphics{path}\caption{caption}\end{figure} |
| Pipe tables | \begin{table}[htbp]\begin{tabular}{...}...\end{tabular}\end{table} |
| Fenced code blocks | \begin{verbatim}...\end{verbatim} |
--- (horizontal rule) | \bigskip\hrule\bigskip or omit |
Preamble Template
\documentclass[a4paper,11pt]{article}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\usepackage[backend=biber,style=authoryear,natbib=true]{biblatex}
\addbibresource{references.bib}
\title{...}
\author{...}
\date{\today}
\begin{document}
\maketitle
% content here
\printbibliography
\end{document}Adjust the preamble based on what the draft actually uses (e.g., skip graphicx if no figures). The natbib=true option provides \citet/\citep compatibility. If the project already uses natbib (e.g., with a journal .bst file), keep natbib — but for new scaffolds, biblatex is the default.
Step 3: Strip Markdown Residue
After conversion, scan the .tex file for any remaining Markdown syntax:
##heading markers**bold markers[@citation markers- Pipe
|table syntax 
