Skip to main content

LaTeX manuscript compilation system for scientific documents with MCP server

Project description

SciTeX Writer

SciTeX Writer

PyPI version Python Versions Documentation License

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.

Preview

Light Mode    Dark Mode

Light mode (default) and dark mode (--dark-mode)

Demo Video

Demo video with AI agent

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

Problem

LaTeX compilation for scientific manuscripts is painful:

  • Environment inconsistency — "It compiles on my machine" is not a solution when collaborating across Linux, macOS, WSL2, and HPC clusters.
  • Manual figure conversion — Converting between PNG, SVG, PDF, Mermaid, and TIFF formats by hand wastes time and introduces errors.
  • No version tracking — Generating tracked-change diffs between revisions requires manual latexdiff invocations and careful file management.
  • Fragmented tooling — Separate workflows for compilation, bibliography management, table formatting, and submission packaging.
  • AI agents cannot help — Without a programmatic interface, AI assistants have no way to compile or manage manuscripts.

Solution

SciTeX Writer solves each of these problems:

  • Container-based reproducible compilation — Consistent builds across all platforms via Docker, Singularity, or native installation with automatic engine selection (Tectonic, latexmk, or 3-pass).
  • Automatic asset conversion — Figures and tables are converted in parallel from source formats (PNG, SVG, comma-separated values (CSV), Mermaid) to LaTeX-ready output.
  • Built-in version tracking with diff generation — Every compilation archives the previous version and generates a latexdiff document automatically.
  • Unified interface — One tool for compilation, bibliography deduplication, figure/table management, and arXiv export packaging.
  • 39 Model Context Protocol (MCP) tools for AI agents — AI assistants can compile, edit, and manage manuscripts programmatically.

Three Interfaces

Interface For Description
Python API Human researchers import scitex_writer as sw
Command-Line Interface (CLI) Commands Terminal users scitex-writer compile, scitex-writer bib
MCP Tools AI agents 39 tools for Claude/GPT integration
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 — Create, Read, Update, Delete (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 — Introduction, Methods, Results, and Discussion (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")

GUI — Browser-based Editor

sw.gui("./my-paper")                              # Launch editor
sw.gui("./my-paper", port=8080, dark_mode=True)  # Custom options
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 to 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

# GUI - Browser-based editor
scitex-writer gui                              # Launch editor (current dir)
scitex-writer gui ./my-paper                   # Open specific project
scitex-writer gui --port 8080 --no-browser     # Custom port, no auto-open
MCP Tools — 39 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 to 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
claim 6 Traceable scientific assertions
migration 2 Overleaf import/export
update 1 Template update from upstream

Claude Desktop (~/.config/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "scitex-writer": {
      "command": "scitex-writer",
      "args": ["mcp", "start"]
    }
  }
}

Full MCP tool reference

Additional Interfaces

Shell Scripts / Make — Direct compilation without Python.

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
./compile.sh manuscript --draft       # Fast single-pass
./compile.sh manuscript --no-figs     # Skip figures
./compile.sh manuscript --dark-mode   # Dark mode (Monaco theme)
./compile.sh manuscript --watch       # Hot-reload
SCITEX_WRITER_DARK_MODE=true make manuscript

GUI Editor — Standalone browser-based editor with file tree, PDF preview, and compilation controls.

GUI Light Mode    GUI Dark Mode

pip install scitex-writer[editor]
scitex-writer gui                    # Current directory
scitex-writer gui ./my-paper         # Specific project
scitex-writer gui --port 8080        # Custom port
Output Structure
./scitex-writer/
├── 00_shared/                  # Shared resources across all documents
│   ├── title.tex / authors.tex / keywords.tex / journal_name.tex
│   ├── bib_files/              # Multiple .bib files (auto-merged and deduplicated)
│   ├── latex_styles/           # Common LaTeX configurations
│   └── templates/              # LaTeX document templates
├── 01_manuscript/              # Main manuscript
│   ├── contents/               # abstract, introduction, methods, results, discussion
│   │   ├── 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 (same structure)
├── 03_revision/                # Revision response letter
│   └── contents/               # editor/, reviewer1/, reviewer2/
├── config/                     # config_manuscript.yaml
└── scripts/                    # containers, installation, shell, python

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)
GUI Editor Browser-based editor with PDF preview (scitex-writer gui)
Dark Mode Monaco/VS Code dark theme for comfortable reading (--dark-mode)
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
  1. Place media files in 01_manuscript/contents/figures/caption_and_media/:

    01_example_figure.png
    01_example_figure.tex  # Caption file
    
  2. 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}
    
  3. Supported formats: PNG, JPEG, PDF, SVG, TIFF, Mermaid (.mmd)

  4. Figures auto-compile and include in FINAL.tex

Tables
  1. Place CSV + caption in 01_manuscript/contents/tables/caption_and_media/:

    01_example_table.csv
    01_example_table.tex  # Caption file
    
  2. CSV auto-converts to LaTeX table format

  3. 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

Part of SciTeX

SciTeX Writer is part of SciTeX. When used inside the orchestrator package scitex, synergy between modules enables end-to-end scientific workflows — from data analysis through publication-ready manuscripts.

The SciTeX ecosystem follows the Four Freedoms for researchers, inspired by the Free Software Definition:

  1. Use — Run the software for any research purpose
  2. Study — Examine how it works and adapt it to your needs
  3. Share — Distribute copies to fellow researchers
  4. Improve — Enhance the software and share improvements with the community

SciTeX
AGPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scitex_writer-2.10.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_writer-2.10.0-py3-none-any.whl (207.1 kB view details)

Uploaded Python 3

File details

Details for the file scitex_writer-2.10.0.tar.gz.

File metadata

  • Download URL: scitex_writer-2.10.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scitex_writer-2.10.0.tar.gz
Algorithm Hash digest
SHA256 c30af2fb8ab87d5882ce136e45e7d88ddf4555dcc70ba3f5348460479178646c
MD5 968df28eb96933cec1000b435631b7b3
BLAKE2b-256 ccc666e22de8f8f94b7fcca3c86e2ea29e6d726df03c43703000c71bc1ec61b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_writer-2.10.0.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-writer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scitex_writer-2.10.0-py3-none-any.whl.

File metadata

  • Download URL: scitex_writer-2.10.0-py3-none-any.whl
  • Upload date:
  • Size: 207.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scitex_writer-2.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf7792cb50f8e085abf530c0a71ff8699f8f466f0fd2798b96d17061f37ee4e0
MD5 a368f507b0506e94a61e112d829f7f5d
BLAKE2b-256 d5e7da26085995600de74e4bdfec681b865702c93734776ccc11ff65a4b84cef

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_writer-2.10.0-py3-none-any.whl:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-writer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page