Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: TikZarium CI

on:
push:
branches: [main, 'feat/**']
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
rust-native:
name: Rust native / ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
target_name: windows-x64
executable_suffix: .exe
- os: macos-15
target_name: macos-arm64
executable_suffix: ""
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.91.0
components: rustfmt, clippy
- name: Toolchain and native target
run: rustc -vV
- name: Verify physical architecture of hosted runner
if: runner.os == 'macOS'
shell: bash
run: |
rustc -vV | grep -F 'host: aarch64-apple-darwin'
- name: Check source formatting
run: cargo fmt --all -- --check
- name: Check crates compile
run: cargo check --workspace --all-targets
- name: Tests
run: cargo test --workspace
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Release binary
run: cargo build --release -p tikzarium-app -p tikzarium-cli
- name: Upload Windows binaries
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: tikzarium-windows-server-build
path: |
target/release/tikzarium-app.exe
target/release/tikzarium-cli.exe
if-no-files-found: error
- name: Upload macOS ARM64 binaries
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: tikzarium-macos-arm64-build
path: |
target/release/tikzarium-app
target/release/tikzarium-cli
if-no-files-found: error

xelatex-linux-smoke:
name: XeLaTeX real fixtures / Linux
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.91.0
- name: Install local TeX + PDF tools
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
texlive-xetex texlive-pictures texlive-latex-extra poppler-utils fonts-dejavu-core
- name: Record environment
run: |
xelatex --version | head -n 2
kpsewhich tikz.sty
kpsewhich standalone.cls
pdftoppm -v
- name: Offline unit tests for PDF Unicode gate
run: python3 -m unittest discover -s scripts/tests -p 'test_qa_unicode_pdf.py' -v
- name: Test CLI build against actual XeLaTeX
run: |
cargo run -p tikzarium-cli -- doctor
mkdir -p /tmp/tikzarium-ci
sha256sum examples/quickstart.tex examples/cyrillic.tex > /tmp/tikzarium-ci/source-before.sha256
cargo run -p tikzarium-cli -- build examples/quickstart.tex /tmp/tikzarium-ci/quickstart.pdf
cargo run -p tikzarium-cli -- build examples/cyrillic.tex /tmp/tikzarium-ci/cyrillic.pdf
pdfinfo /tmp/tikzarium-ci/quickstart.pdf | grep -E '^Pages: *1$'
pdfinfo /tmp/tikzarium-ci/cyrillic.pdf | grep -E '^Pages: *1$'
python3 scripts/qa_unicode_pdf.py /tmp/tikzarium-ci/cyrillic.pdf --expect 'Тест' --expect 'Кириллица.' --expect 'Точка' --extracted-out /tmp/tikzarium-ci/cyrillic-extracted.txt
sha256sum -c /tmp/tikzarium-ci/source-before.sha256
{
rustc -vV
xelatex --version | head -n 2
pdftotext -v 2>&1 | head -n 1
fc-match 'DejaVu Serif'
} > /tmp/tikzarium-ci/environment.txt
sha256sum /tmp/tikzarium-ci/quickstart.pdf /tmp/tikzarium-ci/cyrillic.pdf target/debug/tikzarium-cli > /tmp/tikzarium-ci/output.sha256
pdftoppm -f 1 -singlefile -png -scale-to 1200 \
/tmp/tikzarium-ci/quickstart.pdf /tmp/tikzarium-ci/preview
test -s /tmp/tikzarium-ci/preview.png
- name: Upload smoke PDFs and Unicode evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: tikzarium-xelatex-linux-fixtures
path: /tmp/tikzarium-ci/
if-no-files-found: warn
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/target/
/.idea/
/.vscode/
.DS_Store
*.log
*.aux
*.fls
*.fdb_latexmk
*.synctex.gz
*.xdv
*.toc
*.out
*.run.xml
*.bcf
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

Unreleased development state, no production release.

## Unreleased — 2026-10-31: integration W01 Unicode gate

- Require DejaVu Serif for the W01 Cyrillic sample rather than the implicit Latin Modern font that dropped 19 characters.
- Gate compiled Rust CLI → XeLaTeX PDFs on real Poppler Unicode text extraction; page count alone is insufficient.
- Preserve source hashes and save PDF/CLI SHA-256, tool versions and extracted text; upload partial artifacts on smoke failures.
- Add seven standard-library Python tests for text audit and failure behavior.
- Native Win10 22H2 GUI, physical M1/M4 Retina GUI and production release are **not** accepted. Lua-only graphdrawing is **not** supported by XeLaTeX.

## W01 baseline

- Four-crate Rust workspace, egui shell, XeLaTeX core/CLI, package catalogue and hosted CI in draft PR #6.
- Independent QA PR #9 documented the missing-Cyrillic-glyph false positive.
19 changes: 19 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[workspace]
resolver = "2"
members = [
"crates/tikzarium-core",
"crates/tikzarium-cli",
"crates/tikzarium-app",
"crates/tikzarium-extensions"
]

[workspace.package]
version = "0.1.0"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/i-shutov/tikzarium"

[workspace.dependencies]
tempfile = "3.23"
serde = { version = "1", features = ["derive"] }
thiserror = "2"
59 changes: 26 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
# TikZarium

**Local, extensible scientific graphics workbench for PGF/TikZ.**
Native scientific graphics workbench: **Rust + egui + XeLaTeX**.

**Primary typesetting engine:** XeLaTeX. **Desktop:** Windows 10 x64, macOS Apple Silicon (ARM64). **Implementation:** Rust + egui/eframe.
**Main targets:** Windows 10 x64 and macOS Apple Silicon. No browser, sign-in or cloud service required. The source of truth is the user's ordinary `.tex` or `.tikz` source. Exact rendering comes from XeLaTeX, never a guessed Rust reconstruction.

TikZarium combines faithful TeX rendering with a progressively richer visual editor, semantic geometry, and domain-specific tools. **The original TeX source remains authoritative.** Unknown or unsupported visual constructs must survive round-trips intact.
## Work in progress: W01 XeLaTeX workbench

## Core product contract
An initial workspace is being implemented:
- `tikzarium-core`: UTF-8 source I/O, cancellable XeLaTeX builds, TeX tool discovery, .fls dependencies, log diagnostics and PDF/PNG preview.
- `tikzarium-cli`: `doctor` and `build source.tex output.pdf`.
- `tikzarium-app`: egui desktop shell with text editor, local build, preview, zoom, log and PDF export.
- `tikzarium-extensions`: declarative packages catalogue; presence does not imply validated compilation or visual editing.

- Open and save ordinary `.tex` and `.tikz` projects without proprietary conversion.
- Discover an existing local TeX installation; use **XeLaTeX** for actual rendering, including project preambles, local files and installed XeLaTeX-compatible packages.
- Provide exact PDF preview, source editing, reproducible builds, diagnostics and clear package/engine compatibility status.
- Start with source/preview, then add safe visual edits, a dependency-based geometry engine and opt-in library adapters.
- Offline-first: no cloud service, telemetry or sign-in required.
- Windows 10 x64 and macOS ARM64 are **release gates**, not stretch goals.
**Not yet production-ready.** Core GUI visual object editing, robust arbitrary TikZ fragment preambles and packaged multi-page PDF rendering are future stages. For now the GUI's preview needs optional Poppler `pdftoppm` installed locally.

## Important compatibility distinction
Start at [Developer setup](docs/DEV_SETUP.md), [W01 workpack](plans/2026-10-31_W01_WORKBENCH.md) and [W01 evidence](insights/2026-10-31_W01_EVIDENCE.md).

1. **Compile**: XeLaTeX can compile the project if the required packages and dependencies are installed and compatible.
2. **Inspect**: TikZarium recognizes constructs sufficiently for highlighting, navigation, diagnostics and limited selection.
3. **Visually edit**: a versioned adapter can safely modify specific constructs while preserving unrelated source.
### Local commands

An extension may support level 1 without levels 2 or 3. LuaTeX-only features such as Lua-driven graphdrawing are **not** claimed as available through XeLaTeX.
```sh
cargo run -p tikzarium-cli -- doctor
cargo run -p tikzarium-cli -- build examples/quickstart.tex quickstart.pdf
cargo run -p tikzarium-app
```

## Development documents
## Product direction and contracts

- [Product requirements](docs/PRODUCT_SPEC.md)
- [Requirements](docs/PRODUCT_SPEC.md)
- [Architecture](docs/ARCHITECTURE.md)
- [Extensions and capability model](docs/EXTENSIONS.md)
- [Incremental releases](docs/ROADMAP.md)
- [QA and acceptance](docs/QA_ACCEPTANCE.md)
- [Working conventions](AGENTS.md)
- [Extensibility and TeX package compatibility](docs/EXTENSIONS.md)
- [Progressive releases](docs/ROADMAP.md)
- [QA acceptance](docs/QA_ACCEPTANCE.md)
- [CI matrix](docs/CI_MATRIX.md)
- [Agent and contributor instructions](AGENTS.md)

## Current stage
**Compatibility:** every installed XeLaTeX-compatible TeX package is accessible via the canonical compiler, but GUI recognition and safe visual editing require explicit adapters. LuaTeX-only code is not advertised as XeLaTeX-native. We intend to grow capabilities release by release, not rewrite TeX in Rust.

Planning / architecture baseline. No production-ready Rust application is implied by this documentation.
Research reference corpus: user's R4 TikZ/PGF graphics skills (2026-10-29), with 135 active fixture builds in its original environment; these tests are not yet run on this repository's targets.

Initial research corpus: the user's TikZ/PGF scientific graphics skills R4 (2026-10-29) with 135 active build fixtures and additional semantic tests. The corpus is **referenced, not copied** into this repository until provenance/licensing and artifact-size checks have been completed.

## References

- PGF/TikZ manual: https://tikz.dev/
- CTAN PGF: https://ctan.org/pkg/pgf
- GeoGebra: https://github.com/geogebra/geogebra (architectural study; do not copy code without license review)
- egui: https://github.com/emilk/egui

See [ROADMAP](docs/ROADMAP.md) for the first executable milestone.
Project owner: [i-shutov/tikzarium](https://github.com/i-shutov/tikzarium).
15 changes: 15 additions & 0 deletions crates/tikzarium-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "tikzarium-app"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
tikzarium-core = { path = "../tikzarium-core" }
tikzarium-extensions = { path = "../tikzarium-extensions" }
eframe = { version = "=0.33.3", default-features = false, features = ["default_fonts", "glow", "x11", "wayland"] }
image = { version = "0.25", default-features = false, features = ["png"] }

[target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies]
rfd = "0.15"
Loading
Loading