convert document
1
总安装量
0
周安装量
#49561
全站排名
安装命令
npx skills add https://github.com/midhunxavier/article-writing --skill Convert Document
Skill 文档
Convert Document Skill
Convert documents between LaTeX and DOCX formats. Preserves structure, formatting, citations, and content during conversion.
Overview
This skill enables:
- LaTeX â DOCX conversion
- DOCX â LaTeX conversion
- Preservation of structure and formatting
- Citation conversion (BibTeX â Word bibliography)
- Math equation handling
- Figure and table preservation
Commands
/convert-document <file> [--from latex|docx] [--to latex|docx]
Convert a document between formats.
Parameters:
file(required): Source file to convert--from latex|docx(optional): Source format (default: auto-detect from extension)--to latex|docx(optional): Target format (default: opposite of source)
Conversion Capabilities
LaTeX â DOCX
- Converts
.texto.docx - Preserves document structure (sections, subsections)
- Converts BibTeX citations to Word citations
- Handles math equations (converts to Word equations)
- Preserves figures and tables
- Maintains formatting where possible
DOCX â LaTeX
- Converts
.docxto.tex - Preserves formatting and structure
- Converts Word citations to BibTeX
- Handles math equations (converts to LaTeX math)
- Preserves figures and tables
- Generates proper LaTeX structure
What Gets Preserved
- Structure: Sections, subsections, paragraphs
- Citations: BibTeX â Word bibliography
- Math: LaTeX math â Word equations
- Figures: Image references and captions
- Tables: Table structure and content
- Formatting: Basic formatting (bold, italic, etc.)
Examples
# Convert LaTeX to DOCX
/convert-document main.tex --to docx
# Convert DOCX to LaTeX
/convert-document paper.docx --to latex
# Explicit format specification
/convert-document main.tex --from latex --to docx
Conversion Workflow
- Source Analysis: Analyzes source document structure
- Format Detection: Detects format if not specified
- Content Extraction: Extracts text, citations, math, figures
- Format Conversion: Converts to target format
- Output Generation: Creates converted file
Citation Conversion
BibTeX â Word Bibliography
- Extracts BibTeX entries
- Creates Word bibliography sources
- Updates citations in document
Word Bibliography â BibTeX
- Extracts Word bibliography sources
- Generates BibTeX entries
- Updates citations to
\cite{}format
Math Equation Handling
- LaTeX math â Word equations (via MathML or image conversion)
- Word equations â LaTeX math (via MathML parsing)
- Preserves equation numbering where possible
Limitations
- Complex LaTeX packages may not convert perfectly
- Custom TikZ diagrams may need manual adjustment
- Some formatting nuances may be lost
- Very large documents may take time
Scripts Used
scripts/converter.py– Main conversion script (pandoc-based or python-docx)
Dependencies
pandoc(recommended for best results)python-docx(for DOCX handling)- LaTeX distribution (for LaTeX processing)
Platform Compatibility
Works on all platforms (Claude Code, Codex, OpenCode, Gemini, Cursor). Command syntax may vary by platform – see platform-specific documentation in docs/.