latex-writing

Write and format LaTeX documents for academic journals. Use when: user asks to write LaTeX code, format papers for specific journals (Nature/Science/IEEE/ACM), create equations, tables, or BibTeX entries. NOT for: non-LaTeX writing (use paper-writing), data analysis, or literature search.

564 stars

Best use case

latex-writing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Write and format LaTeX documents for academic journals. Use when: user asks to write LaTeX code, format papers for specific journals (Nature/Science/IEEE/ACM), create equations, tables, or BibTeX entries. NOT for: non-LaTeX writing (use paper-writing), data analysis, or literature search.

Teams using latex-writing should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/latex-writing/SKILL.md --create-dirs "https://raw.githubusercontent.com/beita6969/ScienceClaw/main/skills/latex-writing/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/latex-writing/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How latex-writing Compares

Feature / Agentlatex-writingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Write and format LaTeX documents for academic journals. Use when: user asks to write LaTeX code, format papers for specific journals (Nature/Science/IEEE/ACM), create equations, tables, or BibTeX entries. NOT for: non-LaTeX writing (use paper-writing), data analysis, or literature search.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# LaTeX Academic Writing

Generate publication-ready LaTeX documents, equations, tables, and bibliography entries for academic journals across all disciplines.

## When to Use

- "Write this section in LaTeX for Nature"
- "Format this equation in LaTeX"
- "Create a BibTeX entry for this paper"
- "Generate a LaTeX table from this data"
- "Set up a LaTeX document for IEEE conference"
- "Help me with natbib citation commands"

## When NOT to Use

- General paper writing advice (use paper-writing)
- Literature searching (use literature-search)
- Statistical analysis (use statsmodels-stats or scipy-analysis)
- Figure generation (use matplotlib-viz)

## Journal Templates

### Nature / Nature Communications
```latex
\documentclass[12pt]{article}
\usepackage{times}
\usepackage[margin=2.5cm]{geometry}
\usepackage{amsmath,graphicx,hyperref}
\usepackage[numbers,sort&compress]{natbib}

% Nature: Title, Authors, Affiliations, Abstract (150 words max),
% Main text (2500 words), Methods, References (max 30), Figures (max 6)
\title{Title (max 90 characters)}
\author{Author One$^{1,*}$, Author Two$^{2}$}
\date{}
\begin{document}
\maketitle
\begin{abstract}
% 150 words max. No references. No abbreviations.
\end{abstract}
\section*{Introduction}
\section*{Results}
\section*{Discussion}
\section*{Methods}
\bibliographystyle{naturemag}
\bibliography{refs}
\end{document}
```

### IEEE Conference (IEEEtran)
```latex
\documentclass[conference]{IEEEtran}
\usepackage{amsmath,graphicx,cite}
\title{Paper Title}
\author{\IEEEauthorblockN{First Author}
\IEEEauthorblockA{Affiliation\\Email}}
\begin{document}
\maketitle
\begin{abstract}
% 150-200 words
\end{abstract}
\begin{IEEEkeywords}
keyword1, keyword2
\end{IEEEkeywords}
\section{Introduction}
\section{Related Work}
\section{Methodology}
\section{Experiments}
\section{Conclusion}
\bibliographystyle{IEEEtran}
\bibliography{refs}
\end{document}
```

### ACM (acmart)
```latex
\documentclass[sigconf,review]{acmart}
\title{Paper Title}
\author{Name}{Affiliation}{email}{orcid}{}
\begin{document}
\begin{abstract}
\end{abstract}
\begin{CCSXML}
% ACM CCS concepts
\end{CCSXML}
\keywords{keyword1, keyword2}
\maketitle
\section{Introduction}
\bibliographystyle{ACM-Reference-Format}
\bibliography{refs}
\end{document}
```

### PNAS
```latex
\documentclass[9pt,twocolumn,twoside]{pnas-new}
% 6 pages max, abstract 250 words, significance 120 words
```

### Social Science (APA 7th - apa7)
```latex
\documentclass[man,12pt]{apa7}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}
\addbibresource{refs.bib}
\title{Title}
\authorsnames{Author Name}
\authorsaffiliations{University}
\abstract{Abstract text}
\keywords{keyword1, keyword2}
\begin{document}
\maketitle
\section{Introduction}
\printbibliography
\end{document}
```

## Equation Formatting

### Common Patterns
```latex
% Inline: $E = mc^2$
% Display:
\begin{equation}
  \hat{\beta} = (X^{\top}X)^{-1}X^{\top}y
  \label{eq:ols}
\end{equation}

% Aligned multi-line:
\begin{align}
  \mathcal{L}(\theta) &= \sum_{i=1}^{n} \log p(x_i | \theta) \\
  \nabla_\theta \mathcal{L} &= \sum_{i=1}^{n} \nabla_\theta \log p(x_i | \theta)
\end{align}

% Cases:
\begin{equation}
  f(x) = \begin{cases}
    x^2 & \text{if } x \geq 0 \\
    -x  & \text{if } x < 0
  \end{cases}
\end{equation}
```

### Discipline-Specific Notation
- **Physics**: `\hbar`, `\nabla`, `\partial`, `\langle \psi | \hat{H} | \psi \rangle`
- **Chemistry**: `\ce{H2O}` (mhchem), `\ch{->}` (chemformula)
- **Biology**: Gene names in italics `\textit{TP53}`, protein names upright
- **Economics**: Expectations `\mathbb{E}[X]`, summations with limits
- **Statistics**: `\sim`, `\mid`, `\perp`, hat/tilde for estimators

## Table Formatting

### Publication-Quality Table
```latex
\usepackage{booktabs}
\begin{table}[htbp]
  \centering
  \caption{Results of regression analysis}
  \label{tab:results}
  \begin{tabular}{lcccc}
    \toprule
    Variable & Coeff. & SE & $t$ & $p$ \\
    \midrule
    Intercept & 2.34 & 0.12 & 19.5 & $<$0.001 \\
    Treatment & 0.87 & 0.15 & 5.8  & $<$0.001 \\
    Age       & 0.02 & 0.01 & 2.1  & 0.036 \\
    \bottomrule
  \end{tabular}
  \begin{tablenotes}
    \small
    \item Note: $N = 500$. Standard errors in parentheses.
  \end{tablenotes}
\end{table}
```

## BibTeX Management

### Entry Types
```bibtex
@article{smith2024method,
  author  = {Smith, John A. and Jones, Mary B.},
  title   = {A New Method for Protein Folding},
  journal = {Nature},
  year    = {2024},
  volume  = {625},
  pages   = {123--130},
  doi     = {10.1038/s41586-024-00001-1}
}

@inproceedings{wang2024transformer,
  author    = {Wang, Lei},
  title     = {Efficient Transformers},
  booktitle = {Proceedings of ICML 2024},
  year      = {2024},
  pages     = {1--10}
}

@book{wooldridge2020econometrics,
  author    = {Wooldridge, Jeffrey M.},
  title     = {Introductory Econometrics},
  publisher = {Cengage},
  year      = {2020},
  edition   = {7th}
}
```

### Citation Packages
| Package | Style | Command | Output |
|---------|-------|---------|--------|
| natbib | Author-year | `\citet{key}` | Smith et al. (2024) |
| natbib | Author-year | `\citep{key}` | (Smith et al., 2024) |
| natbib | Numbered | `\cite{key}` | [1] |
| biblatex-apa | APA 7 | `\textcite{key}` | Smith et al. (2024) |
| biblatex-apa | APA 7 | `\parencite{key}` | (Smith et al., 2024) |

## Pre-Submission Checklist

1. **Formatting**: Page limits, font size, margins per journal guidelines
2. **Abstract**: Word count within limit, no undefined abbreviations
3. **Figures**: Resolution >= 300 DPI, vector format preferred (PDF/EPS)
4. **Tables**: Use `booktabs` (no vertical lines), caption above table
5. **References**: All cited works in bibliography, no orphan entries
6. **Cross-references**: All `\ref{}` and `\eqref{}` resolve correctly
7. **Supplementary**: Separate file if required, referenced from main text
8. **Compile**: Clean compilation with no warnings on `\ref` or `\cite`

## Zero-Hallucination Rule

- NEVER generate fake DOIs, journal names, or citation details
- If converting a paper reference to BibTeX, only include fields verified through tool results
- When unsure of a journal's LaTeX class, say so and suggest checking the journal website

Related Skills

writing

564
from beita6969/ScienceClaw

No description provided.

scientific-writing

564
from beita6969/ScienceClaw

Assist with scientific paper writing, LaTeX formatting, abstract drafting, review responses, grant proposals, and academic communication. Use when user asks to write/edit a paper section, draft an abstract, format in LaTeX, respond to reviewer comments, write a grant proposal, or improve academic writing. Triggers on "write abstract", "draft introduction", "LaTeX", "reviewer response", "grant proposal", "improve my writing", "paper draft", "methods section".

review-writing

564
from beita6969/ScienceClaw

No description provided.

protocol-writing

564
from beita6969/ScienceClaw

No description provided.

paper-writing

564
from beita6969/ScienceClaw

Write scientific papers following IMRaD structure with proper citations. Use when: user asks to draft or improve a scientific paper, write specific sections, or format citations. NOT for: non-academic writing or presentation slides.

markdown-mermaid-writing

564
from beita6969/ScienceClaw

Comprehensive markdown and Mermaid diagram writing skill. Use when creating any scientific document, report, analysis, or visualization. Establishes text-based diagrams as the default documentation standard with full style guides (markdown + mermaid), 24 diagram type references, and 9 document templates.

latex-posters

564
from beita6969/ScienceClaw

Create professional research posters in LaTeX using beamerposter, tikzposter, or baposter. Support for conference presentations, academic posters, and scientific communication. Includes layout design, color schemes, multi-column formats, figure integration, and poster-specific best practices for visual communication.

grant-writing

564
from beita6969/ScienceClaw

Assists with research grant proposal writing including specific aims, significance framing, innovation articulation, approach design, and budget justification for NIH, NSF, ERC, and other funding agencies; trigger when users discuss grant proposals, funding applications, or research funding strategy.

article-writing

564
from beita6969/ScienceClaw

Write articles, guides, blog posts, tutorials, newsletter issues, and other long-form content in a distinctive voice derived from supplied examples or brand guidance. Use when the user wants polished written content longer than a paragraph, especially when voice consistency, structure, and credibility matter.

xurl

564
from beita6969/ScienceClaw

A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.

xlsx

564
from beita6969/ScienceClaw

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

world-bank-data

564
from beita6969/ScienceClaw

World Bank Open Data API for development indicators. Use when: user asks about GDP, population, poverty, health, or education statistics by country. NOT for: real-time financial data or stock prices.