Universe

Create project in app

eskd-drafting is a Typst package that generates engineering drawing frames, title blocks (stamps), and technical document layouts in compliance with the Unified System for Design Documentation (ESKD / GOST).

Documentation: Русская версия (Russian) | Full English Specification


Preview 1 Preview 2 Preview 3 Preview 4 Preview 5


Overview

eskd-drafting provides standard drawing borders, official title blocks (Forms 1, 2, 2a, 2b), binding margin inventory stamps, rotated document codes (Box 26), custom font injection, and automatic layout management.

NOTE: eskd-drafting is dedicated strictly to page geometry, margins, drawing frames, title blocks, and inventory margin stamps. The package does not enforce formatting on inner body text, headings, or scientific reports (GOST 7.32).


Quick start

Project initialization (CLI)

typst init @preview/eskd-drafting:0.1.0 my-eskd-document

Direct usage

#import "@preview/eskd-drafting:0.1.0": *

#show: eskd-document.with(
  paper: "a4",                                          // Paper size per GOST 2.301-68
  orientation: "portrait",                              // Portrait orientation (A4 allows only portrait per GOST 2.301)
  preset-lines: "industry",                             // "industry" (0.8 mm thick dividers) or "gost" (0.35 mm thin)
  members: (
    ("Разраб.", "Алексеев",  "12.05.26"),
    ("Пров.",   "Борисов",   "15.05.26"),
    ("Т.контр.","Васильев",  "18.05.26"),
    ("Н.контр.","Григорьев", "19.05.26"),
    ("Утв.",    "Дмитриев",  "20.05.26"),
  ),
  code: [АБВГ.000111.001РЭ],                            // Cell 2: Document code (120x15 mm)
  name: [Блок управления\ Руководство по эксплуатации], // Cell 1: Title (70x25 mm)
  org: [НПК "Электроника"],                             // Cell 9: Organization (50x15 mm)
  lit: [О1],                                            // Cell 4: Litera per GOST 2.103-2013
  mass: [0,05],                                         // Cell 5: Mass in kg (decimal comma)
  scale: [1:1],                                         // Cell 6: Scale per GOST 2.302-68
  code-inverted: auto,                                  // Cell 26: Rotated document code
  inv-orig: [12345],                                    // Cell 19: Inventory number
  sig-date-orig: [12.05.26],                            // Cell 20: Date and signature
)

// 1. Title Page
#show: page-title
#align(center + horizon)[
  #gost-text(h: h7_0, weight: "bold")[РУКОВОДСТВО ПО ЭКСПЛУАТАЦИИ]
]

// 2. Table of Contents (Form 2 with TOC headers -> Form 2a)
#show: page-first-form2.with(
  left: frame-left-7r,
  toc: (num: [], name: [Наименование], code: [Обозначение], note: [Примечание]),
)
#align(center)[#gost-text(h: h5_0, weight: "bold")[СОДЕРЖАНИЕ]]
#outline(title: none)

// 3. Document Body (Form 2 -> Form 2a)
#show: page-first-form2
= 1. Введение
Текст пояснительной записки...

#show: page-body
= 2. Расчетная часть
Продолжение документа...

TIP: In compliance with GOST 2.304-81, eskd-drafting defaults to upright text and avoids synthetic/geometric slanting (which distorts stroke width $d$ and bounding boxes). To use authentic 75° lettering, inject a true GOST font file and set font-italic: true.


Key features

  • Official Title Blocks:
    • Form 1 (185 × 55 mm): Drawings and schematics (first sheet, GOST 2.104-2006).
    • Form 2 (185 × 40 mm, 185 × 52 mm with toc): Text documents and Table of Contents title sheets (GOST 2.104-2006, GOST 2.105 / 2.106).
    • Form 2a (185 × 15 mm): Subsequent sheets for all documents (GOST 2.104-2006).
    • Form 2b (185 × 15 mm): Subsequent sheets for double-sided documents (GOST 2.104-2006).
  • Flexible Page Numbering & Suppression:
    • page: auto / total: auto (dynamic page counting), none (complete suppression of numbers and labels), or custom explicit values (page: 42, total: 100).
  • Side Stamps on Binding Margin (Cells 19–25):
    • frame-left-3r (85 × 12 mm), frame-left-5r (145 × 12 mm), frame-left-7r (H × 12 mm, gap: auto default 47 mm for A4 folding; gap: "max" for top-corner placement).
  • Rotated Document Code (Box 26): Top-left corner document code rotated 180° (code-inverted: auto, none, or custom dict with frame: true/false).
  • Custom Font Injection & CAD Ecosystem Groups: Pass font: "CustomFont" (or "osifont") and select CAD ecosystem font groups via font-group: "ascon" (or "autocad", "solidworks", "tflex", "spds") with automatic GOST 2.304-81 metric calculations (Type A & Type B) and true 75° inclination (font-italic: true).
  • Text Auto-Fitting & Readability Validation:
    • Stepping across standard font heights h ∈ {40.0, …, 1.8} mm.
    • Warnings and errors for excessive shrinkage: < 70% (gost-text-scale-warning) and < 40% (gost-text-scale-extreme).
  • Line Rendering Presets:
    • preset-lines: "industry" (0.8 mm thick dividers, default) or "gost" (0.35 mm thin dividers).
  • Validation Engine (ignore-rules):
    • Automatic validation of scales (GOST 2.302), literas (GOST 2.103), paper formats (GOST 2.301), and line weights (GOST 2.303).

Example catalog (examples/)

Quick start (01-quickstart/)

Drawings and schematics (02-drawings/)

Text documents (03-text-documents/)

Advanced metadata and revisions (04-advanced-features/)

Fonts and line styles (05-typography/)

Custom title blocks (06-custom-stamps/)


Custom title blocks

The package core follows official ESKD standards. Custom enterprise (STO, TU) and academic forms can be integrated via the bottom: or subsequent-bottom: parameters without modifying the core:


Testing and performance

# Install test dependencies
pip install -r ./tests/requirements-dev.txt

# Run unit test suite
python ./tests/tests.py

# Run performance benchmark suite
python ./tests/benchmarks.py
  • Linear Scalability O(N): Compilation time grows proportionally to page count.
  • Export Standards: Validated across PDF 1.7, PDF 2.0, PDF/A (1b, 2b, 3b), PDF/UA-1, SVG, PNG, and HTML.

License

This package uses dual-licensing:

  • The core package and library source code are distributed under the MIT License.
  • The boilerplate and starter code provided in the template/ and examples/ directories are distributed under the MIT No Attribution License (MIT-0). This ensures that you can freely use, modify, and distribute documents created from these templates without any obligation to include the original copyright notice.