Skip to main content

LaTeX manuscript compilation system for scientific documents with MCP server

Project description

SciTeX Writer

PyPI version Python Versions License

scitex.ai ยท 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 Video Thumbnail

๐Ÿ“„ 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 28 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 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)

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

# 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 โ€” 28 tools for AI Agents

Turn AI agents into autonomous manuscript compilers.

Category Tools Description
project 4 Clone, info, PDF paths, document types
compile 3 Manuscript, supplementary, revision
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
usage 1 Project guide

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

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

โ†’ Full MCP tool reference

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

SciTeX
AGPL-3.0 ยท ywatanabe@scitex.ai

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.4.0.tar.gz (2.5 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.4.0-py3-none-any.whl (134.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_writer-2.4.0.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for scitex_writer-2.4.0.tar.gz
Algorithm Hash digest
SHA256 e081a2a4f70d5f4ff044543b5565dd27b32928ad382a4d58d5585657d9ddc90a
MD5 3a14bfd56ae21bfe174f6e6397ec5c39
BLAKE2b-256 6e4d8e059b7f805f5e15a29513453658492e3947aca1eb62202414f2517bca2c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scitex_writer-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 134.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for scitex_writer-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28213d37bf49d95f3c24c8e2c1b03bbfdf60d0dda54a5436f092b499465538e9
MD5 0eefae9f2b20b318f994126688e809d8
BLAKE2b-256 cc83fbacab169787fefc4fdfbaacddfbbd54259b74ef01f29ed9ff9ca6fd4480

See more details on using hashes here.

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