paper-formatter
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.
More from yipng05-max/-skills
literature-verifier
Verify the authenticity of literature references and detect hallucinations in both English and Chinese (中文) sources. Use when users need to check if a citation is real, verify a DOI, confirm a paper/article/book exists, cross-check author-title-journal-year metadata, detect fabricated references, validate URLs of online articles, or audit a reference list for accuracy. Covers journal papers, conference papers, preprints, books, monographs, newspaper articles, magazine articles, web articles, dissertations, government documents, and any other published works. Supports Chinese academic databases including CNKI (知网), Wanfang (万方), CQVIP (维普), Baidu Scholar (百度学术), and core journal list verification (北大核心, CSSCI, CSCD).
11cnki-advanced-search
>
11literature-review-writer
>
9feishu-paper-reviewer
飞书文档论文审阅工具。直接在飞书云文档上进行学术论文审阅,支持高亮、删除线、加粗变色、划词批注、插入审阅意见等多种修订标记。当用户提到对飞书文档/云文档进行论文审阅、审稿、评阅、修改批注,或提供飞书文档链接要求审阅时触发。关键词:飞书论文审阅、飞书审稿、云文档评阅、飞书批注论文。
9cjournal-analyzer
>
8paper-analyzer
学术论文结构化阅读、拆解与分析工具。基于12个阅读要素(研究背景、研究问题、研究结论、文献综合、文献批评、研究方法、理论视角与理论框架、一致性发现、不一致性发现、研究贡献、研究不足、未来研究展望)对论文进行深度拆解,结果保存为Excel文件。当用户提到需要针对论文/文献/paper进行拆解、解析、分析、阅读、梳理,并上传或告知一篇或多篇论文的本地文件路径(PDF、Word等)时触发此skill。
8