From paper
Scientific-paper writing knowledge (MNRAS, A&A, ApJ, JCAP). Covers LaTeX class setup, bibtex via valency-mcp, figure pipelines (matplotlib + TikZ), the Makefile/latexmk build, citation style, common pitfalls (abstract citations, TikZ key clashes, matplotlib without usetex, bibtex requirements), and the recipe to scaffold a new paper repo end-to-end. Auto-loads when the conversation is about writing a paper, formatting LaTeX, building a manuscript PDF, drafting an abstract, or working with references.bib.
How this skill is triggered — by the user, by Claude, or both
Slash command
/paper:explainWhen to use
User mentions writing a paper, LaTeX template, MNRAS / A&A / ApJ / JCAP / Letter, mnras.cls, latexmk, references.bib, bibtex, citation style, \citep / \citet, figure captions, abstract, draft, manuscript, paper.tex, scaffold a paper, journal submission, arxiv.
This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Help with writing and building scientific papers in LaTeX. The recipes
Help with writing and building scientific papers in LaTeX. The recipes below are battle-tested from real submissions; the pitfalls section captures everything we've watched go wrong.
your-paper/
├── paper.tex # main manuscript
├── <journal>.cls # journal class file (vendored, see Recipes below)
├── <journal>.bst # journal bibstyle (vendored)
├── references.bib # bibtex (populated via valency-mcp)
├── figures/ # all paper figures (PDF or PNG)
├── scripts/ # python that produces the figures
├── Makefile # `make` → paper.pdf via latexmk; `make figs`
├── README.md # build instructions, dependencies
├── .gitignore # ignore .aux/.bbl/.log/__pycache__
└── LICENSE
Use /paper:scaffold to bootstrap this layout for a given journal.
Default toolchain: latexmk -pdf -interaction=nonstopmode paper.tex.
The Makefile should provide:
make → build paper.pdfmake figs → regenerate everything in figures/make clean → remove aux filesmake distclean → also remove paper.pdfUse /paper:build for a quick build + error summary; the skill reads
paper.log and paper.blg and reports only what matters.
The valency-mcp server provides arxiv/CrossRef-backed paper search +
bibtex export. The cleanest workflow:
search_by_title(query, limit=3) — to find a paper if you don't
know the arxiv ID. Returns paper objects with id, url,
citation_count.search_by_author(author, start_date=..., limit=10) — to find
all relevant papers by a researcher.export_papers_bibtex(paper_ids=[...]) — batch fetch bibtex.@misc / @book / @article entry by hand.Use /paper:refs to drive this end-to-end given a list of topics.
@article entries MUST have a journal= field, otherwise the
bst will complain. For arxiv preprints use @misc with
eprint = {...}, archivePrefix = {arXiv}, primaryClass = {astro-ph.CO}.{\'e}) over UTF-8.@book and @inproceedings need a publisher= / booktitle=
respectively.Two recipes, picked by complexity:
For plots driven by code/data. Pattern:
# scripts/make_<name>.py
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(7, 4.5), dpi=300)
# ...
fig.savefig("figures/<name>.png", dpi=300, bbox_inches="tight")
Pitfall: matplotlib does NOT process LaTeX macros (\textbf{...},
\sigma, etc.) unless matplotlib.rcParams['text.usetex'] = True —
which itself requires a working TeX install on the runtime path. Without
it, \textbf{foo} appears verbatim. Safe defaults:
r"$\sigma_8$" works, but
r"\textbf{label}" does NOT.weight="bold" keyword instead of \textbf{}.For schematics / diagrams. Always vector, always matches paper fonts. Use this when:
Preamble:
\usepackage[dvipsnames]{xcolor} % NavyBlue, BrickRed, etc.
\usepackage{tikz}
\usetikzlibrary{positioning,arrows.meta,fit,backgrounds,calc}
Recommended pattern: absolute (x, y) coordinates with
scale=0.95, every node/.style={transform shape}, a small palette
of named dvipsnames colours, and one named style per node role.
Avoid the positioning library's right=of ... chains for complex
layouts — they break under refactor and produce cramped output. Use
explicit coordinates instead.
\begin{tikzpicture}[scale=0.95, every node/.style={transform shape},
box/.style ={draw, rounded corners=3pt, minimum height=1.4cm,
font=\small, align=center, thick},
inp/.style ={box, fill=NavyBlue!10, text=NavyBlue!90!black,
minimum width=1.6cm, minimum height=1.0cm},
core/.style ={box, fill=NavyBlue!20, text=NavyBlue!90!black,
minimum width=3.2cm, minimum height=2.0cm},
proc/.style ={box, fill=ForestGreen!15, text=ForestGreen!70!black,
minimum width=3.0cm, minimum height=1.1cm},
store/.style ={box, fill=BurntOrange!18, text=BurntOrange!75!black,
minimum width=2.6cm, minimum height=2.0cm},
emph/.style ={box, fill=BrickRed!15, text=BrickRed!80!black,
minimum width=2.6cm, minimum height=2.0cm},
outbox/.style ={box, fill=NavyBlue!10, text=NavyBlue!90!black,
minimum width=1.6cm, minimum height=1.0cm},
arr/.style ={-{Stealth[length=4pt]}, thick, gray!60},
]
\node[inp] (input) at ( 0.0, 0) {\textbf{input}\\[-1pt]{\scriptsize $\theta$}};
\node[core] (proc) at ( 3.0, 0) {\textbf{processor}\\[1pt]
{\scriptsize subtitle}\\[-1pt]
{\scriptsize detail}};
\node[outbox] (out) at ( 6.0, 0) {\textbf{output}\\[-1pt]{\scriptsize $y$}};
\draw[arr] (input.east) -- (proc.west);
\draw[arr] (proc.east) -- (out.west);
\end{tikzpicture}
Why this pattern works:
inp, core,
proc, store, emph, outbox) — readers visually parse the
diagram faster.text=NavyBlue!90!black on
fill=NavyBlue!10) reads cleanly in print.\\[-1pt]{\scriptsize ...} give
a clean primary/secondary text hierarchy.length=4pt, thick, gray!60 look professional
— avoid the matplotlib-default >-> style.(a.east) -| (b.north)) keep flowcharts
clean when boxes aren't co-linear.Pitfalls (learned the hard way):
out (or in, at, to, from, pos,
angle, loop, bend) — they clash with built-in pgfkeys keys
and you'll see cryptic "The key '/tikz/out' requires a value"
errors. Suffix with box, node, _block to disambiguate.positioning-library right=of ... chains with absolute
coordinates; pick one. For 6+ nodes, absolute coordinates win.dvipsnames xcolor option must come BEFORE \usepackage{tikz}
in the preamble.\citep{key} for parenthetical (Author 2024), \citet{key}
for inline "Author (2024)". For multiple cites:
\citep{a, b, c} renders as "(a; b; c)" in MNRAS.\citealt{key} strips the parentheses entirely (for use inside
larger parens).\citeauthor{key} and \citeyear{key} if you only want one piece.When writing about the halo-model code lineage, citation attributions matter:
szfastdks (the dks is Dolag-Komatsu-Sunyaev) is from
Dolag, Komatsu & Sunyaev 2016 (MNRAS 463, 1797). NOT
Dunkley+13 (which is the ACT likelihood paper).class_sz v1 (Bolliet+18) computes the GNFW profile Fourier
transform via explicit numerical Hankel transforms, not
FFTLog. FFTLog is what classy_szlite uses (via mcfit).v2 CosmoPower emulators in the
cosmopower-organization/ede repository are the emulators used
in the ACT DR6 extended-cosmology analysis (Calabrese et al.
2025, arXiv:2503.14454) and in the ACT DR6 + DESI DR2 EDE
analysis by Poulin et al.\ 2025 (arXiv:2505.08051).Before claiming "code X uses method Y", verify against the upstream source --- it is easy to confuse close-but-different techniques (FFTLog vs explicit Hankel, NFW vs GNFW, Tinker 2008 vs 2010, etc.).
\label{eq:foo} only on
equations you actually reference.TBD.dpi=300 is plenty for a
column-width figure. Above 300dpi the file gets large with no
visual benefit.\input figure scripts — generate the figure file via
make figs and \includegraphics it.mnras.cls from CTAN (see Recipes).[a4paper, fleqn, usenatbib] for two-column A4 with
flush-left equations and natbib citation commands.\bibliographystyle{mnras}; \bibliography{references}.\section*{Acknowledgements}
and \section*{Data Availability} — use the exact words.aa.cls from CTAN (aastex package).\author{...\inst{1} \and ...\inst{2}} +
\institute{...}.aa.bst.aastex631.cls (or whatever the current version is) from
https://journals.aas.org.\paragraph*{Acknowledgements} style sections.aasjournal.curl -sSL -o mnras.cls "https://mirrors.ctan.org/macros/latex/contrib/mnras/mnras.cls"
curl -sSL -o mnras.bst "https://mirrors.ctan.org/macros/latex/contrib/mnras/mnras.bst"
Then \documentclass[a4paper,fleqn,usenatbib]{mnras} in paper.tex.
LaTeX errors out on missing \includegraphics files. Generate stubs:
python -c "
import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as plt
for name in ['fig1','fig2','fig3']:
fig, ax = plt.subplots(figsize=(6, 4))
ax.text(0.5, 0.5, f'[placeholder: {name}]', ha='center', va='center')
ax.set_axis_off()
fig.savefig(f'figures/{name}.png', bbox_inches='tight')
"
pdflatex -interaction=nonstopmode paper.tex 2>&1 | grep -E '^!|Error'grep -E "Citation .* undefined" paper.log | head -5cat paper.blg | grep -iE "error|warning"Common causes (in order of frequency):
\citep keys → bibtex hasn't run, or the key is misspelled.\includegraphics filename missing → check figures/.out / in / at) → rename the style.@article without journal= → either add the field or change to @misc.For full lists of citation commands, journal-specific keywords, and worked examples, see reference.md.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub borisbolliet/paper-claude-plugin --plugin paper