Manuscript export and formatting engine. Supports Markdown (default working format), LaTeX (venue-specific templates with BibTeX generation), and DOCX (via pandoc with reference template). Handles format conversion, template selection, and supplementary material packaging. Trigger phrases include: "export manuscript", "convert to LaTeX", "generate DOCX", "format for JAMA", "export to Word", "write in LaTeX", "create bibliography".
This skill manages all manuscript output formatting and export. It supports three output formats — Markdown, LaTeX, and DOCX — and handles venue-specific template selection, bibliography generation, figure integration, and supplementary material packaging.
Markdown is the default working format for all manuscript drafting. All section-writing skills produce Markdown output that is clean and paste-ready.
# for manuscript title, ## for major sections (Methods, Results, etc.), ### for subsections**text** for emphasis (used sparingly)*text* for journal names, statistical symbols, and gene/species namesFigure 1, eFigure 1, not embedded as images[1], [2,3], [4-7]## Supplementary Materials headingWhen the user copies Markdown output into a manuscript:
The LaTeX template is selected based on target_journal in PAPER_CONTEXT.md or
user request. See references/latex-templates.md for detailed guidance.
| Template | Target Journals | Document Class |
|---|---|---|
| Generic | Any journal not listed below | article with standard packages |
| JAMA | JAMA, JAMA Network Open, JAMA Internal Medicine | Custom JAMA class or article with JAMA formatting |
| Lancet | The Lancet, Lancet Infectious Diseases, Lancet Public Health | article with Lancet formatting |
Template files are stored in templates/latex/. If no template exists for the
requested journal, use the generic template and note: [NOTE: Using generic LaTeX template. Journal-specific formatting may need manual adjustment.]
Every LaTeX document includes:
\documentclass[12pt,a4paper]{article}
% Essential packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{times} % Times New Roman font
\usepackage[margin=1in]{geometry}
\usepackage{setspace} % Line spacing
\usepackage{graphicx} % Figure inclusion
\usepackage{booktabs} % Professional tables
\usepackage{amsmath} % Mathematical notation
\usepackage{hyperref} % DOI and URL links
\usepackage{natbib} % Bibliography management
\usepackage{caption} % Caption formatting
\usepackage{subcaption} % Sub-figures
\doublespacing % Double-spaced by default
Additional packages are loaded as needed based on content (e.g., tikz for
diagrams, longtable for multi-page tables, pdflscape for landscape pages).
When exporting to LaTeX, generate a corresponding .bib file:
@article{page2021prisma,
author = {Page, Matthew J. and McKenzie, Joanne E. and Bossuyt, Patrick M.
and Boutron, Isabelle and Hoffmann, Tammy C. and Mulrow, Cynthia D.
and Shamseer, Larissa and Tetzlaff, Jennifer M. and Akl, Elie A.
and Brennan, Sue E. and others},
title = {The {PRISMA} 2020 statement: an updated guideline for reporting
systematic reviews},
journal = {BMJ},
year = {2021},
volume = {372},
pages = {n71},
doi = {10.1136/bmj.n71},
pmid = {33782057}
}
BibTeX key convention: firstauthorlastname + year + firstkeyword (all lowercase, no spaces).
Figures are included using standard LaTeX float environments:
\begin{figure}[htbp]
\centering
\includegraphics[width=\textwidth]{figures/figure1.pdf}
\caption{Caption text here.}
\label{fig:figure1}
\end{figure}
\ref{fig:figure1} in textSupplementary materials are placed in a separate section or file:
\clearpage
\section*{Supplementary Materials}
\setcounter{figure}{0}
\setcounter{table}{0}
\renewcommand{\thefigure}{e\arabic{figure}}
\renewcommand{\thetable}{e\arabic{table}}
This resets counters and prefixes with "e" for eFigure and eTable numbering.
which pandoc
Run via Bash to detect whether pandoc is installed.
Convert Markdown to DOCX using a reference template:
pandoc manuscript.md \
--reference-doc=templates/docx/reference.docx \
--bibliography=references.bib \
--csl=vancouver.csl \
-o manuscript.docx
The reference.docx template defines:
See references/docx-templates.md for detailed template specifications.
Provide the user with instructions:
[DOCX EXPORT: Pandoc is not installed on this system. To convert to DOCX:
1. Install pandoc: https://pandoc.org/installing.html
2. Run: pandoc manuscript.md --reference-doc=templates/docx/reference.docx -o manuscript.docx
Alternatively, copy the Markdown output into Google Docs or Microsoft Word
and apply formatting manually.]
Per-command DOCX output (e.g., "write methods as DOCX") is deprecated. All DOCX
conversion is handled via the /export-manuscript command, which processes the
complete manuscript at once. This ensures consistent formatting across all sections.
When the user invokes /export-manuscript or "export manuscript":
output_format in PAPER_CONTEXT.mdMarkdown:
LaTeX:
.bib file (Section 2.3).tex file + .bib file + figure filesDOCX:
| Error Condition | Action |
|---|---|
| Missing sections in manuscript | Warn user with list of missing sections; export available sections with placeholders |
| Unknown target journal | Use generic template; note that manual formatting may be needed |
| Pandoc not installed | Provide installation instructions and manual conversion guidance |
| LaTeX compilation fails | Report error; suggest checking package dependencies |
| Figure files not found | Flag with [FIGURE MISSING: expected at <path>] |
| Word count exceeds journal limit | Report excess and suggest sections to trim |
references/abstract-formats.md — Structured abstract formats for all supported journalsreferences/latex-templates.md — LaTeX template selection and preamble guidereferences/docx-templates.md — DOCX template specifications and pandoc commands