Spaces:
Sleeping
Sleeping
File size: 4,009 Bytes
3c2310b a469ee1 3c2310b a469ee1 3c2310b a469ee1 3c2310b a469ee1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
---
title: DOCX to LaTeX Converter
emoji: 📄
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
license: mit
---
# 📄 DOCX to LaTeX Converter API
تبدیلکننده حرفهای فایلهای Word (DOCX) به LaTeX با قابلیتهای پیشرفته
A professional DOCX to LaTeX converter with advanced features and modern web interface.
## 🌟 ویژگیها / Features
### فارسی
- ✅ تبدیل فایلهای DOCX به LaTeX با کیفیت بالا
- ✅ استخراج و حفظ تصاویر
- ✅ سازگار با Overleaf
- ✅ حفظ فرمتها و استایلها
- ✅ تولید فهرست مطالب خودکار
- ✅ دانلود فایل کامل در قالب ZIP
- ✅ رابط API ساده و قدرتمند
- ✅ اجرا رایگان روی Hugging Face Spaces
### English
- ✅ High-quality DOCX to LaTeX conversion
- ✅ Image extraction and preservation
- ✅ Overleaf compatibility
- ✅ Style and formatting preservation
- ✅ Automatic table of contents generation
- ✅ Complete ZIP package download
- ✅ Simple and powerful API interface
- ✅ Free hosting on Hugging Face Spaces
## 🚀 استفاده / Usage
### API Endpoints
#### 1. Health Check
```bash
GET /api/health
```
#### 2. Upload File
```bash
POST /api/upload
Content-Type: multipart/form-data
Body: file (DOCX file)
```
#### 3. Convert Document
```bash
POST /api/convert
Content-Type: application/json
Body: {
"task_id": "string",
"output_filename": "string",
"options": {
"generateToc": boolean,
"extractMedia": boolean,
"overleafCompatible": boolean,
"preserveStyles": boolean,
"preserveLineBreaks": boolean
}
}
```
#### 4. Download Complete Package
```bash
GET /api/download-complete/{task_id}
```
### مثال استفاده / Example Usage
```python
import requests
# Upload file
with open('document.docx', 'rb') as f:
response = requests.post('https://YOUR_USERNAME-docx-to-latex.hf.space/api/upload',
files={'file': f})
task_id = response.json()['task_id']
# Convert
convert_response = requests.post('https://YOUR_USERNAME-docx-to-latex.hf.space/api/convert',
json={
'task_id': task_id,
'options': {
'generateToc': True,
'extractMedia': True,
'overleafCompatible': True
}
})
# Download complete package
download_response = requests.get(f'https://YOUR_USERNAME-docx-to-latex.hf.space/api/download-complete/{task_id}')
with open('converted_package.zip', 'wb') as f:
f.write(download_response.content)
```
## 🔧 نصب محلی / Local Installation
```bash
git clone https://github.com/YOUR_USERNAME/docx-to-latex.git
cd docx-to-latex
pip install -r requirements.txt
python app.py
```
## 📚 مستندات / Documentation
این API امکان تبدیل فایلهای Word به LaTeX با حفظ فرمتها، تصاویر و جداول را فراهم میکند. خروجی نهایی شامل فایل LaTeX و پوشه تصاویر در قالب ZIP است که مستقیماً در Overleaf قابل استفاده است.
This API provides seamless conversion from Word documents to LaTeX while preserving formatting, images, and tables. The final output includes the LaTeX file and media folder in a ZIP package ready for use in Overleaf.
## 🤝 مشارکت / Contributing
مشارکتها خوشحال دریافت میشوند! لطفاً Issue ایجاد کرده یا Pull Request ارسال کنید.
Contributions are welcome! Please feel free to submit issues or pull requests.
## 📄 مجوز / License
MIT License - برای جزئیات فایل LICENSE را مشاهده کنید.
MIT License - see LICENSE file for details. |