The K2F format operates on a dual-state architecture: an editable, declarative semantic JSON tree (State A) and a compiled, pixel stable lock (document.K2F.lock / State C) packaged inside a self-contained ZIP archive. While Quarto delegates layout, typography, and visual styling downstream to target-specific renderers—web browsers running CSS for HTML, TeX or Typst typesetting engines for PDF, and desktop office suites for DOCX/PPTX—resulting in fluid, viewport-dependent reflow, unpredictable page splits, and multi-engine font drift without a unified coordinate specification, K2F compiles semantic intent into deterministic geometry using a dedicated Rust reference layout engine (k2f_layout), strictly isolating content meaning from visual theme primitives and mandating embedded fonts.
K2F is not a lossless superset of Quarto (.qmd). K2F v0.1 strictly prohibits executable scripts, computational kernels, and dynamic code evaluation: it cannot execute Python, R, or Julia code, evaluate live expressions, generate dynamic plots on the fly, or build interactive client-side web dashboards (format: dashboard, Observable JS). In addition, K2F v0.1 ships with a fixed "paged" canvas mode (slide presentations and infinite canvas modes are roadmap design targets), does not import PDF or Word files (PDF_IS_NOT_A_SOURCE, DOCX_IS_NOT_A_SOURCE), does not natively import or parse .qmd files (QUARTO_IS_NOT_A_SOURCE), restricts vector graphics in State A (arbitrary programmatic vector paths are forbidden; complex graphics must be stored as pre-rendered SVGs or images in /assets/), lacks a native BibTeX/CSL citation engine, does not target academic journal submission templates (ACM, IEEE, Elsevier), and does not build multi-page static websites or books (quarto website, quarto book). Bringing Quarto-generated computational output into K2F requires rendering the document to standard Markdown (e.g., quarto render document.qmd --to gfm), which executes code chunks and outputs static assets, and then ingesting the resulting Markdown via K2F's Markdown bridge (k2f markdown) with an author template shell. All export formats derived from K2F are unidirectional, read-only deliverables rendered from the compiled render lock rather than round-trip sources of truth (PDF_IS_NOT_A_SOURCE, DOCX_IS_NOT_A_SOURCE, PPTX_IS_NOT_A_SOURCE, IDML_IS_NOT_A_SOURCE).
At a glance
| Topic | Quarto (.qmd) | K2F |
|---|---|---|
| What the file is | Plain-text computational markup file (.qmd) interleaving YAML frontmatter, Pandoc Markdown prose, and executable code blocks | Declarative semantic JSON tree (State A) + compiled render lock (State C) in a ZIP archive |
| Primary authoring model | Interactive authoring in VS Code / RStudio, computational data science notebooks, academic manuscripts, and technical documentation | Programmatic authoring, inspection, and patching by AI agents and automated code pipelines |
| Computational code execution | Native execution of live code (R, Python, Julia, Observable JS) via Knitr, Jupyter, or OJS engines during compilation | Prohibited: no runtime kernel, script execution, or dynamic evaluation; stores finalized semantic content only |
| Physical page geometry | Zero native page geometry; no coordinates, millimeter margins, card bounds, running header bounding boxes, or page budgets | Explicit paged canvas geometry, margin definitions, multi-column stacks, page budgets, card containers, and running headers/footers |
| Rendering architecture | Deferred to downstream target engines: web browsers (CSS) for HTML, TeX or Typst for PDF, and Microsoft Office for DOCX/PPTX | Dual-state model: reference engine compiles deterministic geometry; viewers paint document.K2F.lock directly without reflowing text |
| Pixel-stable pages & fonts | Non-pixel-stable; reflows per browser/office viewport; relies on un-embedded system fonts; LaTeX micro-typographic shifts; table/code splits across pages | Yes — viewers paint the lock directly; mandatory embedded fonts (assets/fonts/) guarantee cross-device pixel stability |
| Node addressing for AI | Selective author labels for figures, tables, equations, and sections; standard prose blocks (paragraphs, lists, table cells) lack logical IDs | Mandatory, hierarchical dotted IDs (parent_id.child_type_semantic_name) on every semantic node in State A |
| Layout & page budgets | Non-deterministic page breaks; tables severed mid-row; code blocks and captions cleaved across page splits | Deterministic reference layout engine calculates physical coordinates, page budgets, and card containers |
| Font embedding & encoding | Relies on host-installed system fonts, TeX font packages, or external web fonts; font substitutions cause cross-platform text drift | Mandatory complete embedded fonts (assets/fonts/); standard text shaping (HarfBuzz / rustybuzz) and Unicode NFC normalization |
| Separation of concerns & styling | Fragmented: SCSS for HTML, LaTeX packages/preamble for PDF, Typst parameters for Typst, reference template for DOCX; no cross-format style abstraction | Strict separation: zero styling on State A nodes; visual primitives live exclusively in styles/theme.json |
| Theming & global restyling | Multi-target styling requires maintaining parallel SCSS, TeX, Typst, and Word template files; cannot re-theme all targets from one token | Single token change in styles/theme.json restyles entire document deterministically upon recompilation |
| Agent round-trip & Git diffs | AST re-serialization introduces cosmetic churn (YAML formatting, chunk options, table alignment, hard-wrapping) | Git-native Canonical JSON (sorted keys, 2-space indentation) ensures clean semantic diffs; schema-validated |
| Execution state & caching | Prone to stale cache: editing code without runtime/data dependencies causes render failures or cache invalidation (_freeze/) | Guaranteed synchronization: State A compiles deterministically into State C geometry lock without external runtime dependencies |
| Interactive widgets & dashboards | Native Quarto Dashboards (format: dashboard), interactive Plotly/Leaflet charts, and client-side Observable JS widgets | Interactive JS prohibited; static vector/raster images in /assets/; native form_field compiles to interactive AcroForms |
| Citations & academic publishing | Native BibTeX/CSL citation engine, DOI resolution, automated numbered/author-year bibliographies, and formal journal templates | No native BibTeX/CSL citation parsing or academic journal submission templates in v0.1 |
| Vector graphics & art | Programmatic plot generation (ggplot2, Matplotlib) outputting SVG/PDF; inline raw SVG and Mermaid/Graphviz diagrams | Forbidden in State A JSON; arbitrary vector paths not supported; external vector graphics stored as SVGs or raster images in /assets/ |
| Prepress & design supply chain | No export to Adobe InDesign; no native fillable AcroForm PDF generation; relies on standard Pandoc writers | Single-source lock-drawn exports to PDF (with AcroForms), Microsoft Word (.docx), PowerPoint (.pptx), and InDesign (.idml with Document Fonts/) |
| Cryptographic integrity & trust | Zero cryptographic signatures, content hashing, appearance hashing, or tamper-evident headers in .qmd | Dual-hash architecture (content_hash, appearance_hash), optional Ed25519 signatures, mandatory viewer banner (SIGNED, UNSIGNED, SIGNED_BUT_BROKEN, BROKEN_INTEGRITY, UNLOCKED) |
| Execution security model | Renders by executing user code (Python, R, Bash, Lua) on host machine; running untrusted files requires external sandboxing | Zero-execution architecture: no scripts, runtime code, or dynamic expressions; safe execution model for automated agent pipelines |
| Verification tooling | Syntax validation via quarto check and YAML schemas; no visual or layout verification | Automated schema validation via pack_verify.py (validating embedded /schema/) and visual defect detection (PAGE_UNDERFILL) |
| Automation & MCP API | Quarto CLI and language-specific automation wrappers | Native offline CLI (pip install k2f), Python SDK, Rust crates, and stdio MCP; remote HTTP MCP is Not publicly specified |
| Import / Source of truth | Authoritative source for data science; exports to DOCX/PPTX suffer source divergence; K2F does not import .qmd (QUARTO_IS_NOT_A_SOURCE) | .K2F is sole source of truth; exports are unidirectional lock drawings; no PDF import (PDF_IS_NOT_A_SOURCE); ingests rendered output via Markdown bridge (k2f markdown) |
Quarto (.qmd) vs K2F: What Quarto (.qmd) is good at
Quarto is a mature open-source publishing system engineered for reproducible computational research, scientific communication, and multi-format technical publishing. Its primary strengths include:
- Reproducible computational research and data science: Quarto provides a unified literate programming environment for data-intensive reports and empirical research. Authors write code directly in R, Python, Julia, or Observable JS alongside narrative text, execute computations via Knitr or Jupyter kernels, and embed generated tables and high-resolution figures directly into the compiled output.
- Academic and scientific journal submissions: Quarto provides native authoring support and official formatting templates for leading scientific publishers and societies, including ACM, IEEE, Elsevier, Springer Nature, PLOS, Taylor & Francis, and AGU. Authors can generate submission-ready PDF manuscripts conforming precisely to publisher specifications.
- Comprehensive citation management and bibliographies: Built-in integration with BibTeX, CSL (Citation Style Language), DOI lookups, and reference managers (such as Zotero). Quarto automatically formats in-text citations (
@knuth1984) and compiles complete reference lists according to thousands of standardized academic styles (APA, Chicago, IEEE, Nature). - Automated cross-referencing and mathematical typesetting: Robust, standardized labeling and hyperlinking for figures (
#| label: fig-chartreferenced via@fig-chart), tables (@tbl-summary), equations (@eq-linear), theorems, callout blocks, and section headings (@sec-methods). LaTeX mathematical notation renders seamlessly across all output formats (HTML via MathJax/KaTeX, PDF via TeX/Typst, DOCX via native Word OMML). - Multi-format publishing from a single text source: A single
.qmddocument can compile into a wide variety of presentation media: responsive HTML pages, publication-grade PDFs (via XeLaTeX, pdfLaTeX, LuaLaTeX, or Typst), Microsoft Word (.docx), PowerPoint (.pptx), HTML presentation decks (Reveal.js), Beamer slides, ePub books, and interactive dashboards. - Interactive dashboards and client-side reactive visualization: Native support for Quarto Dashboards (
format: dashboard), enabling authors to construct grid-based analytical dashboards containing summary cards, metric value boxes, interactive maps (Leaflet), interactive charts (Plotly), and client-side reactive components (Observable JS) that run directly in web browsers. - Multi-document publishing (Books and Websites): Built-in project orchestration via
_quarto.yml:quarto bookcompiles multi-chapter volumes with automated cross-chapter numbering and unified search, whilequarto websitegenerates structured documentation sites deployed directly to GitHub Pages, Posit Connect, Netlify, or Quarto Pub viaquarto publish. - Integrated developer ecosystem: Backed by Posit PBC and an active open-source community, Quarto integrates deeply with modern development environments (VS Code extension with visual WYSIWYM and source editing modes, RStudio, Positron, JupyterLab) and is widely used across academic institutions, data science teams, and research organizations.
What K2F adds
K2F is engineered for workflows where automated systems and AI agents require deterministic structure, verifiable rendering, and multi-format delivery:
- Declarative semantic tree & stable dotted IDs: Every node in State A (
content/root.json) carries a mandatory, hierarchical dotted ID (format:parent_id.child_type_semantic_name, e.g.,financials.q3_results.table_revenue,contract.clauses.clause_4_indemnity). AI agents can target, read, patch, diff, and revert specific content nodes deterministically without scraping visual coordinates, parsing arbitrary Markdown text blocks, or relying on fragile line-number targeting. Long documents can be modularized via explicit{ "include": "content/sub_section.json" }fragments in containerchildren. - Pre-compiled pixel-stable lock (
document.K2F.lock): K2F pairs an editable semantic tree with a compiled render lock (State C). The Rust reference layout engine (k2f_layout) calculates exact physical coordinates using HarfBuzz text shaping (rustybuzz), Unicode line breaking (UAX #14), and IEEE-754 math layout. Official viewers (<k2f-viewer>, Desktop Reader, Playground) paint the published lock directly without running layout or reflowing body text in the browser, guaranteeing PDF-grade visual consistency. - Mandatory embedded fonts & elimination of visual drift: Quarto relies on system-installed fonts or external web fonts, causing typography, glyph advances, and line breaks to shift across operating systems and TeX distributions. K2F mandates complete embedded fonts in
assets/fonts/and strictly prohibits un-embedded system fonts, ensuring identical rendering on every machine. - Strict intent-presentation separation & global restyling: Quarto fragments visual styling across disparate target technologies (SCSS for HTML, raw LaTeX preambles for PDF, Typst parameters, external Word
.docxtemplates). K2F strictly forbids inline styling on State A nodes; appearance is governed entirely by named design primitives instyles/theme.json(palette,corner_radius,elevation). Content nodes reference appearance via semantic roles, variants, and closed-enum modifiers with UTF-8 byte ranges (emphasis,link,math). A single prompt or theme token edit restyles an entire document deterministically upon recompilation without layout drift. - Deterministic layout compilation & automatic reflow: In Quarto, paged document layout is delegated to external engines with heuristic line-breaking, frequently resulting in computational tables severed mid-row, code listings split across page breaks, or orphaned captions. K2F compiles layout deterministically against fixed page budgets, recalculating bounding boxes and card structures while preserving typographic harmony.
- Safe, zero-execution security architecture: Rendering a Quarto document executes arbitrary embedded code (Python, R, Julia, Bash, Lua) on the local host with the user's permissions, requiring external sandbox isolation when evaluating untrusted files. K2F strictly prohibits executable scripts, runtime code, and dynamic template expressions (
design.md§ Prohibited features), providing a deterministic, zero-execution data format safe for automated agent processing. - Automated package verification (
pack_verify.py): K2F packages embed formal JSON schemas in/schema/. The stdlib-onlypack_verify.pyscript and CLIk2f packvalidate structural rules, font coverage, and modifier constraints. When run with--render, the compiler rasterizes pages to preview PNGs and detects visual defects such asPAGE_UNDERFILL(flagging when content fails to fill the lower third of a designed page), enabling agents to self-correct layout issues before delivery. - Dual-hash cryptographic integrity & mandatory viewer banner: Quarto documents have no native cryptographic hashing, signatures, or tamper-evident features. K2F implements a built-in cryptographic integrity architecture:
content_hashhashes the canonical semantic tree, whileappearance_hashbinds content, theme primitives, embedded fonts, canvas setup, and the pinned reference engine identity (engine_commit_sha). Official readers enforce a mandatory integrity banner reporting five canonical states (SIGNED,UNSIGNED,SIGNED_BUT_BROKEN,BROKEN_INTEGRITY,UNLOCKED), while reporting layout engine discrepancies (ENGINE_MISMATCH). Ed25519 digital signatures can be attached viasignatures/v1.json. - Git-native Canonical JSON & clean version control: Automated AST round-tripping in Quarto often introduces cosmetic churn in Git diffs (YAML formatting variations, chunk option syntax normalization, pipe table realignment, hard-wrapping prose). K2F source trees are maintained as Canonical JSON (alphabetically sorted keys, 2-space indentation) with images stored as standalone files in
assets/images/, enabling AI agents and human engineers to review clean semantic diffs, resolve merge conflicts, and audit changes node by node. - Native fillable PDF forms (AcroForm): K2F's
form_fieldsemantic nodes compile directly into genuine interactive AcroForm PDF fields upon export, bridging agent-generated form logic with universal PDF distribution without drawing non-functional visual underscores (____). - Single-source enterprise and design supply chain: A single
.K2Fdocument compiles once to produce lock-drawn deliverables for PDF (with interactive AcroForms), Microsoft Word (.docx), PowerPoint (.pptx), and Adobe InDesign (.idmlwithDocument Fonts/). In contrast, Quarto cannot export to Adobe InDesign and cannot generate fillable AcroForm PDFs. Under K2F's architectural rules, exports are unidirectional drawings of the render lock, not editable sources (PDF_IS_NOT_A_SOURCE,DOCX_IS_NOT_A_SOURCE,PPTX_IS_NOT_A_SOURCE,IDML_IS_NOT_A_SOURCE). - Agent tooling and production template ecosystem: K2F provides an official agent skill implementing the
agent_v0authoring dialect, native CLI tools (pip install k2f), and a public Gallery of 469+ production templates on k2f.dev with multi-format downloads (.K2F,.docx,.pptx,.idml) without requiring accounts, logins, or subscriptions. Remote HTTP MCP is Not publicly specified (stdio MCP is supported).
When to pick which
-
Pick Quarto (.qmd) when:
- Authoring computational research papers, empirical data science reports, or statistical analyses requiring live code execution in R, Python, Julia, or Observable JS.
- Submitting academic manuscripts to journals (ACM, IEEE, Elsevier, Springer) that mandate standardized TeX preambles, CSL/BibTeX citation formatting, or publisher-specific submission bundles.
- Creating interactive web dashboards (
format: dashboard) with client-side reactive components, interactive Plotly charts, or Leaflet maps. - Publishing multi-chapter digital textbooks (
quarto book) or multi-page technical documentation websites (quarto website) deployed viaquarto publish. - The document's primary value is its executable computational pipeline and the ability for readers to independently rerun code and verify data transformations.
-
Pick K2F when:
- Producing formal, boardroom-ready, paged business and marketing deliverables (executive summaries, financial disclosures, contracts, proposals, invoices, certificates, flyers, or multi-page reports) that demand exact typography, page budgets, and print-ready presentation.
- Autonomous AI agents and automated code pipelines must programmatically inspect, target, patch, and validate document content using stable dotted node IDs without fragile regex string scraping or array index drift.
- Documents demand cross-device, cross-platform pixel stability via embedded fonts and a pre-compiled geometry lock (
document.K2F.lock), avoiding viewport-dependent reflow and chaotic PDF export page breaks. - Publishing from a single source of truth to PDF (with interactive AcroForms), Microsoft Word (
.docx), PowerPoint (.pptx), and Adobe InDesign (.idml) simultaneously. - Workflows require Git-native semantic version control without formatting churn, theme-driven restyling without layout shifts, and tamper-evident cryptographic integrity banners.
- Processing documents from untrusted sources or external agents in zero-execution enterprise environments where arbitrary code execution is strictly forbidden.
-
Bridging Quarto (.qmd) and K2F (The Complementary Pipeline):
- Quarto and K2F are not mutually exclusive; they form a natural, complementary data-to-publication pipeline. Data scientists and researchers can use Quarto to analyze data, train machine learning models, execute R/Python code, and generate visual figures; an automated script or agent exports the rendered computational output to clean Markdown and image files (
quarto render analysis.qmd --to gfm); and K2F's Markdown bridge (k2f markdown) ingests the content, attaches an author template withstyles/theme.jsonand embedded fonts, and compiles a boardroom-ready, pixel-stable, tamper-evident executive deliverable. Deliverables exported from K2F are unidirectional drawings of the compiled render lock, not editable sources of truth (PDF_IS_NOT_A_SOURCE,DOCX_IS_NOT_A_SOURCE,PPTX_IS_NOT_A_SOURCE,IDML_IS_NOT_A_SOURCE). All authoritative structural edits occur in K2F State A.
- Quarto and K2F are not mutually exclusive; they form a natural, complementary data-to-publication pipeline. Data scientists and researchers can use Quarto to analyze data, train machine learning models, execute R/Python code, and generate visual figures; an automated script or agent exports the rendered computational output to clean Markdown and image files (
Bottom line
Quarto (.qmd) and K2F address two distinct, non-overlapping stages of document creation. Quarto is the premier computational workbench for data scientists and researchers, orchestrating live code execution, academic citations, and multi-backend conversion. However, Quarto leaves layout, typography, and styling to downstream target engines, resulting in visual reflow, fragmented theming, and formatting instability across output formats.
K2F provides the missing publication master for automated, agent-driven document workflows. By separating semantic intent from deterministic geometry through a dual-state architecture, K2F allows teams to transform raw analysis and extracted figures into pixel-stable, boardroom-ready deliverables across PDF, Word, PowerPoint, and InDesign. Rather than choosing between them, data teams can pair Quarto as the computational engine with K2F as the final publishing compiler.
For additional details on K2F architecture, explore the technical documentation, review pre-built templates in the Gallery, read why K2F exists, or view the full matrix on Compare.
This comparison is based on publicly available information at the time of writing. Capabilities, pricing, and policies may change; verify details with the relevant provider.