LaTeX manuscript compilation system for scientific documents with MCP server
Project description
scitex.ai ยท docs ยท pip install scitex-writer
LaTeX compilation system for scientific manuscripts with automatic versioning, diff generation, and cross-platform reproducibility.
Part of the SciTeX ecosystem โ empowers both human researchers and AI agents.
๐ฌ Demo
๐ Demo prompt and progress report (org | pdf) | Manuscript output | Revision output
๐ฆ Installation
# LaTeX dependencies (Ubuntu/Debian)
sudo apt-get install texlive-latex-extra latexdiff parallel imagemagick ghostscript
# LaTeX dependencies (macOS)
brew install texlive latexdiff parallel imagemagick ghostscript
# Python package + MCP server
pip install scitex-writer
Quick Start
git clone https://github.com/ywatanabe1989/scitex-writer.git my-paper
cd my-paper && make manuscript # or: ./compile.sh manuscript
Four Interfaces
| Interface | For | Description |
|---|---|---|
| ๐ Shell/Make | Direct compilation | make manuscript, ./compile.sh |
| ๐ Python API | Human researchers | import scitex_writer as sw |
| ๐ฅ๏ธ CLI Commands | Terminal users | scitex-writer compile, scitex-writer bib |
| ๐ง MCP Tools | AI agents | 30 tools for Claude/GPT integration |
๐ Shell Scripts / Make
# Make commands (recommended)
make manuscript # Compile manuscript
make supplementary # Compile supplementary
make revision # Compile revision
make all # Compile all documents
make manuscript-export # Package for arXiv submission
make clean # Remove build artifacts
# Shell scripts (direct)
./compile.sh manuscript --draft # Fast single-pass
./compile.sh manuscript --no-figs # Skip figures
./compile.sh manuscript --no-tables # Skip tables
./compile.sh manuscript --watch # Hot-reload
๐ Python API
Compile โ Build PDFs
import scitex_writer as sw
sw.compile.manuscript("./my-paper") # Full compile
sw.compile.manuscript("./my-paper", draft=True) # Fast draft mode
sw.compile.supplementary("./my-paper")
sw.compile.revision("./my-paper", track_changes=True)
Export โ arXiv Submission
sw.export.manuscript("./my-paper") # arXiv-ready tarball
sw.export.manuscript("./my-paper", output_dir="/tmp") # Custom output dir
Tables/Figures/Bib โ CRUD Operations
# Tables
sw.tables.list("./my-paper")
sw.tables.add("./my-paper", "results", "a,b\n1,2", "Results summary")
sw.tables.remove("./my-paper", "results")
# Figures
sw.figures.list("./my-paper")
sw.figures.add("./my-paper", "fig01", "./plot.png", "My figure")
sw.figures.remove("./my-paper", "fig01")
# Bibliography
sw.bib.list_files("./my-paper")
sw.bib.add("./my-paper", "@article{Smith2024, title={...}}")
sw.bib.merge("./my-paper") # Merge + deduplicate
Guidelines โ IMRAD Writing Tips
sw.get_guideline("abstract")
sw.build_guideline("abstract", draft="Your draft...")
sw.list_guidelines() # ['abstract', 'introduction', 'methods', 'discussion', 'proofread']
Prompts โ AI2 Asta
from scitex_writer import generate_asta
result = generate_asta("./my-paper", search_type="related")
๐ฅ๏ธ CLI Commands
scitex-writer --help # Show all commands
# Compile - Build PDFs
scitex-writer compile manuscript # Compile manuscript
scitex-writer compile manuscript --draft # Fast single-pass
scitex-writer compile supplementary # Compile supplementary
scitex-writer compile revision # Compile revision letter
# Export - arXiv submission
scitex-writer export manuscript # Package for arXiv upload
# Bibliography - Reference management
scitex-writer bib list-files # List .bib files
scitex-writer bib list-entries # List all entries
scitex-writer bib get Smith2024 # Get specific entry
scitex-writer bib add '@article{...}' # Add entry
scitex-writer bib remove Smith2024 # Remove entry
scitex-writer bib merge # Merge and deduplicate
# Tables - CSVโLaTeX management
scitex-writer tables list # List tables
scitex-writer tables add results data.csv "Caption"
scitex-writer tables remove results
# Figures - Image management
scitex-writer figures list # List figures
scitex-writer figures add fig01 plot.png "Caption"
scitex-writer figures remove fig01
# Guidelines - IMRAD writing tips
scitex-writer guidelines list # List available sections
scitex-writer guidelines abstract # Get abstract guidelines
scitex-writer guidelines abstract -d draft.tex # Build prompt with draft
# Prompts - AI2 Asta integration
scitex-writer prompts asta # Generate related papers prompt
scitex-writer prompts asta -t coauthors # Find collaborators
# MCP server management
scitex-writer mcp list-tools # List all MCP tools (markdown)
scitex-writer mcp doctor # Check server health
scitex-writer mcp installation # Show Claude Desktop config
scitex-writer mcp start # Start MCP server
๐ง MCP Tools โ 30 tools for AI Agents
Turn AI agents into autonomous manuscript compilers.
| Category | Tools | Description |
|---|---|---|
| project | 4 | Clone, info, PDF paths, document types |
| compile | 4 | Manuscript, supplementary, revision, content |
| tables | 5 | CSVโLaTeX, list/add/remove tables |
| figures | 5 | Convert, render PDF, list/add/remove |
| bib | 6 | List files/entries, CRUD, merge/dedupe |
| guidelines | 3 | List, get, build with draft |
| prompts | 1 | AI2 Asta prompt generation |
| export | 1 | arXiv-ready tarball packaging |
| usage | 1 | Project guide |
Claude Desktop (~/.config/Claude/claude_desktop_config.json):
{
"mcpServers": {
"scitex-writer": {
"command": "scitex-writer",
"args": ["mcp", "start"]
}
}
}
Output Structure
./scitex-writer/
โโโ 00_shared/ # Shared resources across all documents
โ โโโ title.tex # Manuscript title
โ โโโ authors.tex # Author names and affiliations
โ โโโ keywords.tex # Keywords for the manuscript
โ โโโ journal_name.tex # Target journal name
โ โโโ bib_files/ # Multiple .bib files (auto-merged and deduplicated)
โ โโโ latex_styles/ # Common LaTeX configurations
โ โโโ templates/ # LaTeX document templates
โ
โโโ 01_manuscript/ # Main manuscript
โ โโโ contents/ # Modular content sections
โ โ โโโ abstract.tex
โ โ โโโ introduction.tex
โ โ โโโ methods.tex
โ โ โโโ results.tex
โ โ โโโ discussion.tex
โ โ โโโ figures/ # Figure captions + media
โ โ โโโ tables/ # Table captions + CSV data
โ โโโ archive/ # Version history (gitignored)
โ โโโ manuscript.tex # Compiled LaTeX
โ โโโ manuscript_diff.tex # Change-tracked version
โ โโโ manuscript.pdf # Output PDF
โ
โโโ 02_supplementary/ # Supplementary materials
โ โโโ contents/ # Supplementary content sections
โ โ โโโ supplementary_methods.tex
โ โ โโโ supplementary_results.tex
โ โ โโโ figures/ # Supplementary figures
โ โ โโโ tables/ # Supplementary tables
โ โโโ archive/ # Version history (gitignored)
โ โโโ supplementary.tex # Compiled LaTeX
โ โโโ supplementary.pdf # Output PDF
โ
โโโ 03_revision/ # Revision response letter
โ โโโ contents/ # Reviewer responses
โ โ โโโ editor/ # E_01_comments.tex, E_01_response.tex
โ โ โโโ reviewer1/ # R1_01_comments.tex, R1_01_response.tex
โ โ โโโ reviewer2/ # R2_01_comments.tex, R2_01_response.tex
โ โโโ archive/ # Version history (gitignored)
โ โโโ revision.tex # Compiled LaTeX
โ โโโ revision.pdf # Output PDF
โ
โโโ config/ # Configuration files
โ โโโ config_manuscript.yaml # Citation style, engine settings
โ
โโโ scripts # Compilation scripts
โโโ containers/ # Container image builds (Apptainer/Singularity)
โโโ installation/ # Environment setup and dependency installation
โโโ maintenance/ # Repository maintenance (usage, update, demos)
โโโ powershell/ # Windows PowerShell scripts
โโโ python/ # Python utilities
โโโ shell/ # Core compilation scripts
Features
Details
| Feature | Description |
|---|---|
| Separated Files | Modular sections (abstract, intro, methods, results, discussion) |
| Built-in Templates | Pre-configured manuscript, supplementary materials, and revision |
| Bibliography | Multi-file with auto-deduplication, 20+ citation styles |
| Assets | Parallel figure/table processing (PNG, PDF, SVG, Mermaid, CSV) |
| Multi-Engine | Auto-selects best engine (Tectonic 1-3s, latexmk 3-6s, 3-pass 12-18s) |
| Cross-Platform | Linux, macOS, WSL2, Docker, Singularity, HPC clusters |
Usage
PDF Compilation
# Basic compilation
./scripts/shell/compile_manuscript.sh # Manuscript
./scripts/shell/compile_supplementary.sh # Supplementary
./scripts/shell/compile_revision.sh # Revision letter
# Performance options
./scripts/shell/compile_manuscript.sh --draft # Fast single-pass
./scripts/shell/compile_manuscript.sh --no-figs # Skip figures
./scripts/shell/compile_manuscript.sh --no-tables # Skip tables
./scripts/shell/compile_manuscript.sh --no-diff # Skip diff generation
# Engine selection
./scripts/shell/compile_manuscript.sh --engine tectonic # Fastest
./scripts/shell/compile_manuscript.sh --engine latexmk # Standard
./scripts/shell/compile_manuscript.sh --engine 3pass # Most compatible
# Development
./scripts/shell/compile_manuscript.sh --watch # Hot-reload on file changes
./scripts/shell/compile_manuscript.sh --clean # Remove cache
Figures
-
Place media files in
01_manuscript/contents/figures/caption_and_media/:01_example_figure.png 01_example_figure.tex # Caption file -
Caption file format (
01_example_figure.tex):%% Figure caption \caption{Your figure caption here. Explain panels (A, B, C) if applicable.} \label{fig:example_figure_01}
-
Supported formats: PNG, JPEG, PDF, SVG, TIFF, Mermaid (.mmd)
-
Figures auto-compile and include in
FINAL.tex
Tables
-
Place CSV + caption in
01_manuscript/contents/tables/caption_and_media/:01_example_table.csv 01_example_table.tex # Caption file -
CSV auto-converts to LaTeX table format
-
Caption file format (
01_example_table.tex):%% Table caption \caption{Your table caption. Define abbreviations used.} \label{tab:example_table_01}
References
Organize references in multiple .bib files - they auto-merge with deduplication:
00_shared/bib_files/
โโโ methods_refs.bib # Method-related references
โโโ field_background.bib # Background literature
โโโ my_papers.bib # Your own publications
Change citation style in config/config_manuscript.yaml:
unsrtnat(numbered, order of citation)plainnat(numbered, alphabetical)apalike(author-year, APA style)IEEEtran(IEEE format)naturemag(Nature style)
Documentation
Details
| Guide | Description |
|---|---|
| Installation | Setup for all environments |
| Quick Start | Common workflows |
| Content Creation | Writing manuscripts |
| Bibliography | Reference management |
| Architecture | Technical details |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scitex_writer-2.6.1.tar.gz.
File metadata
- Download URL: scitex_writer-2.6.1.tar.gz
- Upload date:
- Size: 815.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af22a0d3a07620b30733b2bd124fa4c04c8f15ea5684c1fd8bb73a1e1855b544
|
|
| MD5 |
2040ebecfe9a78ce97c36b7f725685ce
|
|
| BLAKE2b-256 |
0b6431f8dbce2561425d831881fb7af7a34e9aa2f64e02bc8828b4d36224d745
|
File details
Details for the file scitex_writer-2.6.1-py3-none-any.whl.
File metadata
- Download URL: scitex_writer-2.6.1-py3-none-any.whl
- Upload date:
- Size: 144.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
402a8157c2ca3be67c8a279b3d6710c1d3da24000b9e8db668c572d2d61b940e
|
|
| MD5 |
3869dd365e739b613a2dcc5d7bb2babb
|
|
| BLAKE2b-256 |
edc0b706f0a765268685d4fa32b21ae3534a02dd3e0cc6d7d3142bf0d0731666
|