paper-formatter
Skill302 starsChanged 7 months agoMITView on GitHub
Format academic manuscripts to match a target journal's style. Use when users provide a sample paper (范文) from a journal and want their manuscript reformatted to match. Supports Word (.docx) and LaTeX (.tex) input/output. Covers Chinese and English journals. Handles title/abstract formatting, heading styles, body text font/size/spacing, figure/table captions, reference/bibliography style, page layout (margins, columns, headers/footers), footnotes, and section numbering.
- Installs packages
In this repository35 other files it gives its agents.
- analytic-memoSkill
- argument-auditorSkill
- cjournal-analyzerSkill
- cnki-advanced-searchSkill
- concept-clarifierSkill
- conceptual-framework-builderSkill
- counterfactual-reasoningSkill
- design-coherence-checkSkill
- feishu-paper-reviewerSkill
- foreign-literature-searchSkill
- grounded-codingSkill
- introduction-writerSkill
- literature-review-writerSkill
- literature-verifierSkill
- memo-coachSkill
- negative-case-finderSkill
- paper-analyzerSkill
- paper-reviewerSkill
- paper-title-abstract-keywordsSkill
- pdf-bib-importSkill
- phd-literature-reviewSkill
- problematizationSkill
- skill-installerSkill
- strategy-makerSkill
- ta-discussion-writerSkill
- ta-findings-writerSkill
- ta-framework-builderSkill
- ta-framework-writerSkill
- ta-methods-writerSkill
- ta-research-AFP-autoSkill
- ta-research-AFPSkill
- text-to-excelSkill
- thematic-analysisSkill
- theory-fit-assessmentSkill
- top-journals-methods-scoutSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Ask the user for:
- Distinctive: line 23
Run the analysis script:
- Very specific: line 39
Read the .tex file and extract style information from the preamble:
- Distinctive: line 66
Ask the user to confirm or adjust any rules before proceeding.
- Distinctive: line 70
Read the user's manuscript and extract structured content:
- Very specific: line 93
For
.docxmanuscripts: use python-docx to read paragraphs, classify by style (similar to analyze_docx.py logic). - Distinctive: line 97
For plain text: ask the user to identify sections or use heuristic detection (numbered headings, "Abstract:", "References" headers).
- Distinctive: line 116
After generating the output:
- Distinctive: line 118
Ask them to review and identify any formatting issues
- Very specific: line 129
Use ctexart document class for LaTeX output
≈ “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
Paper Formatter Skill
Reformat an academic manuscript to match the style of a target journal, based on a sample paper (范文).
Workflow
Step 1: Receive Inputs
Ask the user for:
- Sample paper (范文): A paper from the target journal that exemplifies its formatting. Can be
.docxor.tex. - User manuscript: The manuscript to reformat. Can be
.docx,.tex, or plain text. - Desired output format:
.docxor.tex(default: same as manuscript format).
Step 2: Analyze Sample Paper Style
If sample is .docx:
Run the analysis script:
pip install python-docx 2>/dev/null
python ~/.claude/skills/paper-formatter/scripts/analyze_docx.py "<sample.docx>" "<output_rules.json>"This extracts:
- Page layout (margins, paper size, orientation, columns)
- Paragraph styles per role (title, headings, body, abstract, captions, references)
- Font families, sizes, bold/italic
- Line spacing, indentation, paragraph spacing
- Table styles
- Citation style detection (numeric, author-year, etc.)
If sample is .tex:
Read the .tex file and extract style information from the preamble:
\documentclassoptions (font size, paper, columns)\usepackage{geometry}margins- Font packages and settings (
fontspec,xeCJK,ctex) \usepackage{setspace}line spacing\titleformat/\titlesecheading styles- Citation package (
natbib,biblatex) and style \fancyhdrheader/footer settings- Custom commands for title, abstract, keywords formatting
Produce a JSON style-rules object with the same structure as the docx analyzer output.
Step 3: Present Extracted Style Rules
Show the user a summary of extracted formatting rules organized by the checklist in references/formatting-elements.md:
- Page: paper size, margins, orientation
- Title: font, size, bold, alignment
- Authors/Affiliations: format
- Abstract: font, size, indentation
- Keywords: separator, font
- Headings: each level's font, size, bold, numbering scheme
- Body: font, size, line spacing, first-line indent, alignment
- Captions: position, font, size
- References: citation style, bibliography format
- Header/Footer: content
Ask the user to confirm or adjust any rules before proceeding.
Step 4: Parse User Manuscript
Read the user's manuscript and extract structured content:
{
"title": "...",
"authors": ["..."],
"affiliations": ["..."],
"abstract": "...",
"keywords": ["..."],
"sections": [
{
"heading": "Introduction",
"level": 1,
"content": ["paragraph1...", "paragraph2..."],
"subsections": [...]
}
],
"references": ["[1] ...", "[2] ..."],
"acknowledgments": "...",
"footnotes": ["..."]
}For .docx manuscripts: use python-docx to read paragraphs, classify by style (similar to analyze_docx.py logic).
For .tex manuscripts: parse section commands (\section, \subsection), extract text between them, identify \begin{abstract}, \bibliography, etc.
For plain text: ask the user to identify sections or use heuristic detection (numbered headings, "Abstract:", "References" headers).
Step 5: Apply Formatting
If output is .docx:
Save the structured content to a temporary JSON file, then run:
python ~/.claude/skills/paper-formatter/scripts/format_docx.py "<content.json>" "<style_rules.json>" "<output.docx>"If output is .tex:
python ~/.claude/skills/paper-formatter/scripts/generate_latex.py "<content.json>" "<style_rules.json>" "<output.tex>"Step 6: Review & Iterate
After generating the output:
- Tell the user the output file path
- Ask them to review and identify any formatting issues
- Adjust style rules or content structure as needed
- Re-run the formatting script with updated inputs
Important Notes
Chinese Journal Support (中文期刊支持)
- Chinese font size names (字号) are mapped: 五号=10.5pt, 小四=12pt, etc.
- Common Chinese fonts: 宋体 (body), 黑体 (headings), 楷体 (abstract), 仿宋
- First-line indent: typically 2em (2 characters)
- Use
ctexartdocument class for LaTeX output - GB/T 7714-2015 citation format with document type identifiers [J], [M], [C], etc.
- Full-width punctuation handling
Citation Styles
Refer to references/common-citation-styles.md for detailed formatting rules for:
- APA 7th, GB/T 7714-2015, Vancouver, IEEE, Chicago, MLA
Formatting Checklist
Refer to references/formatting-elements.md for the complete list of formatting elements to check and apply.
Dependencies
python-docx: Required for .docx analysis and generation. Install withpip install python-docx.- For LaTeX output: the generated .tex file requires XeLaTeX compilation (for font support).
- Chinese LaTeX documents require:
ctex,xeCJKpackages and appropriate Chinese fonts installed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

