Skip to main content

A block-based content framework for Streamlit — styled pages, CSS Grid, diagrams, LaTeX, and more.

Project description

StreamTeX

A block-based content framework for Streamlit — build styled, structured web books with Python.

StreamTeX provides a modular "block" architecture on top of Streamlit, letting you compose rich styled pages with CSS Grid layouts, inline mixed-style text, diagrams, LaTeX, bibliography, navigation, and more — all without writing raw HTML or CSS.

Installation

pip install streamtex

Optional: enable the live code inspector sidebar:

pip install streamtex[inspector]

Quick Start

import streamlit as st
import streamtex as sx
from streamtex.styles.core import Style

st.set_page_config(page_title="My Book", layout="wide")

style = Style("color: navy; font-size: 1.2em;", "my-style")
sx.st_write(style, "Hello StreamTeX!")

Run it:

streamlit run app.py

Features

  • Styled textst_write with tuple support for inline mixed-style text
  • CSS Grid layoutsst_grid with responsive columns
  • Block containersst_block / st_span context managers
  • Listsst_list with ul/ol, custom bullets, centered alignment
  • Imagesst_image with base64 encoding and MIME detection
  • Code blocksst_code with Pygments syntax highlighting
  • Diagrams — Mermaid, PlantUML, TikZ with pan/zoom
  • LaTeX — math formulas and full documents
  • Bibliography — BibTeX/RIS/CSL-JSON import, citations, formatted references
  • Book orchestrationst_book with paginated and continuous modes
  • Table of Contents — auto-numbering and anchor navigation
  • Navigation markers — slide-like PageUp/PageDown navigation
  • Collections — multi-project hubs with TOML configuration
  • HTML export — self-contained dual-rendering pipeline
  • Style compositionStyle objects with + / - operators
  • Zoom controls — CSS-based width and zoom adjustments
  • Block inspector — live code editor in sidebar (optional)
  • Block helpers — DI-injectable helpers with 3 usage modes

Documentation

Online manuals (read & explore)

Examples (source code)

The manuals are also available as source code — clone and run them locally to study the examples:

git clone https://github.com/nicolasguelfi/streamtex-docs
cd streamtex-docs
uv sync
uv run streamlit run manuals/stx_manual_intro/book.py

See streamtex-docs for the full list of example projects.

Reference

Project Structure

A StreamTeX project follows this layout:

my-project/
├── .streamlit/
│   └── config.toml          # enableStaticServing = true
├── blocks/
│   ├── __init__.py           # Block registry
│   └── bck_intro.py          # Your blocks (build() function each)
├── static/
│   └── images/               # Static assets
├── custom/
│   └── styles.py             # Project-specific styles
└── book.py                   # Entry point with st_book()

Requirements

  • Python >= 3.10
  • Streamlit >= 1.54.0

License

MIT — Copyright (c) 2026 Nicolas Guelfi

Project details


Release history Release notifications | RSS feed

This version

0.3.1

Download files

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

Source Distribution

streamtex-0.3.1.tar.gz (140.2 kB view details)

Uploaded Source

Built Distribution

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

streamtex-0.3.1-py3-none-any.whl (160.2 kB view details)

Uploaded Python 3

File details

Details for the file streamtex-0.3.1.tar.gz.

File metadata

  • Download URL: streamtex-0.3.1.tar.gz
  • Upload date:
  • Size: 140.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for streamtex-0.3.1.tar.gz
Algorithm Hash digest
SHA256 316ccba8c0a772d2b69bb6c54df29266d57f799f346b236d0b36a4fa0eb75f40
MD5 19e6f912eaf2447b6bd7d722cc1d73d0
BLAKE2b-256 042e845794bf259d09ba29cdf0e7531213ba2b0e1ec46441810d178b1f36de0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for streamtex-0.3.1.tar.gz:

Publisher: publish.yml on nicolasguelfi/streamtex

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

File details

Details for the file streamtex-0.3.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for streamtex-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0643d60a67e55c8ce992c49e16954a3633f39e4fbcb31c6af24abae7afea3f86
MD5 5b5bc144d7f3bed891ee7dccf126c82d
BLAKE2b-256 7d065b78a76c0e6593568191c8afae5c7ccc2e39b0e1d6abde46226f3b38ff1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for streamtex-0.3.1-py3-none-any.whl:

Publisher: publish.yml on nicolasguelfi/streamtex

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