papr-pdf 0.1.0

A fast, keyboard-first CLI tool to compile Markdown, LaTeX, and plain text files into publication-grade PDFs.
# papr 📄

> **Lightning-fast CLI tool to compile Markdown, LaTeX, and Plain Text files into publication-grade PDFs.**

[![Crates.io](https://img.shields.io/crates/v/papr-cli.svg)](https://crates.io/crates/papr-cli)
[![License: MIT OR Apache-2.0](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE)

`papr` gives you an Overleaf-grade typesetting workflow right inside your terminal. It handles:
- **Markdown (`.md`)**: Full GitHub Flavored Markdown, embedded KaTeX math ($E=mc^2$), and syntax-highlighted code blocks.
- **LaTeX (`.tex`)**: Multi-file project support (`\input`, `\include`, `\includegraphics`) powered by Tectonic / XeTeX with automatic package resolution.
- **Plain Text (`.txt`)**: Clean monospaced layout with headers, line wrapping, and page margins.

---

## 🚀 Quick Start

### Installation

```bash
cargo install papr-cli
```

### 1. Interactive Mode (No Arguments)
Just type `papr` and hit Enter:

```text
$ papr
? Select document format to compile:
  ❯ 1. Markdown (.md)
    2. LaTeX (.tex)
    3. Plain Text (.txt)

? Enter path to input file (press [Tab] to autocomplete):
  ❯ chapters/main.tex

✔ Generated: chapters/main.pdf (84.2 KB, 0.38s)
```

### 2. Direct Command Mode

```bash
# Markdown to PDF
papr README.md

# Multi-file LaTeX to PDF (Overleaf-style)
papr thesis/main.tex

# Plain Text notes to PDF
papr meeting_notes.txt

# Specify custom output path
papr report.md -o ~/Desktop/report.pdf

# Open PDF immediately in your system viewer
papr paper.tex --open
```

---

## 🎨 Themes

For Markdown and Text files, choose between built-in styling themes:

```bash
papr document.md --theme academic    # (Default) Classical serif, Latin Modern typography
papr document.md --theme modern      # Clean, minimalist sans-serif
papr document.md --theme github      # GitHub flavored markdown aesthetic
papr document.md --theme dark        # Night mode / OLED friendly
```

---

## 🧩 Overleaf-Style Multi-File Support

When compiling `.tex` documents with `\input{...}` or `\includegraphics{...}`:

```text
my-paper/
├── main.tex
├── figures/
│   └── architecture.png
└── sections/
    ├── intro.tex
    └── results.tex
```

Run `papr my-paper/main.tex` and all relative sub-files and images resolve seamlessly!

---

## 📦 Publishing to crates.io

To publish updates:
```bash
cargo publish
```

---

## 📄 License

Dual-licensed under either of:
- [Apache License, Version 2.0]LICENSE-APACHE
- [MIT license]LICENSE-MIT