docx-to-latex
Installation
SKILL.md
DOCX to LaTeX Converter
Convert Word documents to LaTeX with accurate math formula conversion.
Quick Start
Run the conversion script:
python scripts/docx_to_latex.py input.docx output.tex --images-dir images
Workflow
1. Basic Conversion
python scripts/docx_to_latex.py document.docx document.tex
This extracts:
- Text content with formatting (bold, italic, underline)
- Headings →
\section,\subsection, etc. - Lists →
itemize/enumerate - Tables →
tabularenvironment - Images → extracted to
images/folder - Math formulas (OMML) → LaTeX math notation
2. Review Math Formulas
After conversion, verify complex formulas in the output .tex file. The converter handles:
- Fractions:
\frac{a}{b} - Subscripts/superscripts:
x_{i}^{2} - Radicals:
\sqrt{x},\sqrt[n]{x} - Integrals/sums:
\int_{a}^{b},\sum_{i=1}^{n} - Matrices:
pmatrixenvironment - Greek letters and math symbols
- Delimiters with auto-sizing:
\left( \right)
For OMML element details, see references/omml_conversion.md.
3. Compile LaTeX
pdflatex output.tex
Required packages (auto-included in preamble):
amsmath,amsfonts,amssymb- math supportgraphicx- imageshyperref- linksbooktabs- tables
Manual Adjustments
After automatic conversion, may need manual fixes for:
| Issue | Solution |
|---|---|
| Complex nested formulas | Verify bracket matching |
| Custom macros in original | Define in preamble |
| Equation numbering | Add \label{} and use equation environment |
| Figure captions | Update auto-generated "Image" captions |
| Table alignment | Adjust column specs in tabular |
Example
Input (Word with OMML):
- Equation: "The quadratic formula is x = (-b ± √(b²-4ac)) / 2a"
Output (LaTeX):
The quadratic formula is $x = \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a}$
Related skills
More from qyqsdtc/financial_analysis_agent_skill
financial-analysis
专业的上市公司财务报表分析技能。用于分析PDF格式的财务报告(季报、半年报、年报),提取三大报表数据,计算盈利能力、偿债能力、运营能力、现金流质量、成长性等多维度财务指标,进行杜邦分析和趋势分析,生成投资评级和建议。支持生成Markdown和Excel格式的专业分析报告。当用户请求分析财报、计算ROE/ROA等财务指标、评估公司财务健康状况、生成投资建议时使用此技能。
23stock-analysis
个股技术分析技能。使用akshare获取A股数据,ta-lib计算技术指标(MA、MACD、RSI、KDJ、布林带等),分析股票趋势(上涨、震荡、即将突破),生成明确的交易计划。当用户请求分析某只股票、判断买卖点、技术面分析时使用此技能。
2