Convert Typst to FB2

Drag and drop files here or click to select.
Max file size 100mb.
Uploading progress:

Typst vs FB2 Format Comparison

Aspect Typst (Source Format) FB2 (Target Format)
Format Overview
Typst
Modern Typesetting System

Typst is a modern typesetting system launched in 2023, designed as a simpler, faster alternative to LaTeX. It combines intuitive markup for headings, formatting, math, and tables with a scripting engine for variables and functions. The Rust-based compiler provides fast incremental compilation with instant preview.

Typesetting Modern
FB2
FictionBook 2.0

FB2 (FictionBook 2.0) is an XML-based ebook format widely used in Russia and Eastern Europe. Created by Dmitry Gribov in 2004, it stores the entire book as a single XML file with embedded images encoded in Base64. FB2 focuses on semantic structure rather than visual presentation, making it ideal for fiction and non-fiction books.

Ebook Format XML-Based
Technical Specifications
Structure: Plain text with Typst markup and scripting
Encoding: UTF-8
Format: Modern typesetting language
Compiler: Typst CLI (Rust-based)
Extensions: .typ
Structure: Single XML file with XSD schema
Encoding: UTF-8 XML
Images: Base64-encoded within XML
Standard: FictionBook 2.0 (fb2.xsd)
Extensions: .fb2, .fb2.zip
Content Support
  • Headings with = syntax
  • Built-in math mode with $ delimiters
  • Tables via #table() function
  • Variables and functions (#let, #set)
  • Bibliography with #bibliography()
  • Figures with #figure() and captions
  • Cross-references with @label
  • Code blocks with backtick syntax
  • Sections and subsections
  • Rich text (bold, italic, strikethrough)
  • Embedded Base64 images
  • Book metadata (title, author, genre)
  • Epigraphs and annotations
  • Footnotes and comments
  • Poems and citations
Advantages
  • Much simpler syntax than LaTeX
  • Incremental compilation with instant preview
  • Built-in scripting language
  • Excellent error messages
  • Fast Rust-based compiler
  • Modern package management
  • Self-contained single XML file
  • Rich book metadata support
  • Popular in Russian-language ebook market
  • Semantic structure for content reflow
  • Easy to parse and transform
  • Many free readers available
Disadvantages
  • Newer ecosystem with fewer packages
  • Not yet widely adopted in academia
  • Limited journal template support
  • Fewer online resources and tutorials
  • Still evolving specification
  • Limited adoption outside Eastern Europe
  • No CSS styling support
  • Limited table support
  • No math equation rendering
  • Large file sizes with embedded images
Common Uses
  • Academic papers and reports
  • Technical documentation
  • Mathematical documents
  • Presentations and slides
  • Resumes and cover letters
  • Fiction and non-fiction ebooks
  • Russian-language digital libraries
  • Personal ebook collections
  • Online bookstores (LitRes, Bookmate)
  • Ebook archival and distribution
Software Support
Editor: Typst app (web), VS Code with Tinymist
Compiler: Typst CLI (open source, Rust)
Packages: Typst Universe (package registry)
Platforms: Windows, macOS, Linux, Web
Readers: FBReader, CoolReader, AlReader
Desktop: Calibre, FBReader (cross-platform)
Editors: FB2 Editor, Sigil (with plugin)
Converters: Calibre, Pandoc, fb2converter
Best For
  • Academic papers and theses
  • Technical documentation
  • Mathematical content
  • Modern document typesetting
  • Russian/CIS e-book market
  • Fiction reading
  • E-book libraries
  • PocketBook devices
Version History
Introduced: 2023 (Martin Haug & Laurenz Mäger)
Language: Written in Rust
Status: Active development
License: Apache 2.0
Introduced: 2004 (Dmitry Gribov)
Current: FB2.1
Status: Maintained
Popular in: Russia/CIS countries

Why Convert Typst to FB2?

Converting Typst to FB2 format enables you to distribute your documents as ebooks in the FictionBook format, which is extremely popular in Russia and Eastern European countries. FB2 is the dominant ebook format on platforms like LitRes, the largest Russian ebook store, and is supported by popular readers like FBReader and CoolReader that are used by millions of people.

The FB2 format stores everything in a single self-contained XML file, including text, metadata, and Base64-encoded images. This makes FB2 files easy to store, share, and archive. The semantic XML structure ensures that content reflows properly on different screen sizes, from smartphones to dedicated e-readers.

For authors writing in Typst who want to reach Russian-speaking audiences, FB2 conversion is essential. The format's rich metadata support captures title, author, genre, annotation, and cover image -- all important for discoverability in ebook stores and libraries. The conversion preserves your document's section structure, text formatting, and embedded images.

Key Benefits of Converting Typst to FB2:

  • Eastern European Market: Reach millions of readers on LitRes and Bookmate
  • Self-Contained: Single XML file with all content and images
  • Rich Metadata: Title, author, genre, annotation, and cover support
  • Popular Readers: FBReader, CoolReader, AlReader compatibility
  • Semantic Structure: Content reflows to any screen size
  • Easy Sharing: Single file for distribution and archival
  • Calibre Compatible: Convert further to any format via Calibre

Practical Examples

Example 1: Fiction Novel Chapter

Input Typst file (novel.typ):

#set document(
  title: "The Last Algorithm",
  author: "Alex Writer",
)

= Chapter 1: The Discovery

The laboratory was _quiet_ except for
the hum of servers. Dr. Petra stared
at her screen, unable to believe what
the *neural network* had produced.

"This is impossible," she whispered.

= Chapter 2: The Proof

Three days had passed since the discovery.
The team gathered in the conference room.

Output FB2 file (novel.fb2):

<FictionBook>
  <description>
    <title-info>
      <book-title>The Last Algorithm
      </book-title>
      <author>Alex Writer</author>
    </title-info>
  </description>
  <body>
    <section>
      <title>Chapter 1: The Discovery
      </title>
      <p>The laboratory was
      <emphasis>quiet</emphasis>...</p>
    </section>
  </body>
</FictionBook>

Example 2: Non-Fiction Guide

Input Typst file (guide.typ):

= Photography for Beginners

== Understanding Light
Light is the *foundation* of photography.
There are two types:
- Natural light (sun, moon)
- Artificial light (flash, studio)

== Composition Rules
The _rule of thirds_ divides the frame
into a 3x3 grid. Place key elements
along the grid lines for better balance.

Output FB2 file (guide.fb2):

FictionBook XML with:
- Book metadata and genre tags
- Sections for each chapter
- Bold and italic formatting
- List items as paragraphs
- Compatible with FBReader
- Single self-contained file
- Ready for LitRes upload

Example 3: Technical Reference

Input Typst file (reference.typ):

= Git Quick Reference

== Basic Commands

*Clone a repository:*
```
git clone https://github.com/user/repo.git
```

*Check status:*
```
git status
```

== Branching
Create a new branch with:
`git checkout -b feature-name`

Output FB2 file (reference.fb2):

FictionBook reference:
- Section-based navigation
- Code blocks as preformatted text
- Bold command names preserved
- Inline code with emphasis
- Readable on mobile FBReader
- Offline access on any device
- Compact single XML file

Frequently Asked Questions (FAQ)

Q: What is FB2 format?

A: FB2 (FictionBook 2.0) is an XML-based ebook format popular in Russia and Eastern Europe. It stores the entire book as a single XML file with embedded Base64-encoded images. It is widely used on ebook platforms like LitRes and supported by readers like FBReader and CoolReader.

Q: Can I read FB2 files on my e-reader?

A: Many e-readers support FB2, especially those popular in Eastern Europe (PocketBook, Onyx Boox). On other devices, use FBReader (available for Android, iOS, Windows, macOS, Linux) or Calibre to read FB2 files. You can also convert FB2 to EPUB with Calibre for broader compatibility.

Q: How are Typst math expressions handled in FB2?

A: FB2 does not have native math equation support. Typst math expressions are converted to their plain text representation within the FB2 structure. For documents with heavy mathematical content, consider EPUB3 format which supports MathML.

Q: Are images embedded in the FB2 file?

A: Yes. Images from Typst #figure() commands are embedded in the FB2 file as Base64-encoded binary data within XML elements. This keeps the FB2 as a self-contained single file with no external dependencies.

Q: Can I publish the FB2 file on LitRes?

A: Yes. LitRes (the largest Russian ebook store) accepts FB2 format for publishing. The book metadata including title, author, genre, and annotation are extracted from your Typst document and embedded in the FB2 file's description section.

Q: How are Typst tables handled in FB2?

A: FB2 has limited table support. Typst tables are converted to structured text or simple FB2 table elements where supported. Complex multi-column tables may be simplified for best display in FB2 readers. Consider EPUB or DOCX for documents with many tables.

Q: What metadata is preserved in the FB2 output?

A: The FB2 format supports rich metadata including book title, author name, genre, annotation (summary), date, language, and cover image. Typst document properties from #set document() are mapped to FB2 metadata fields.

Q: Can I convert FB2 to other ebook formats?

A: Yes. Calibre, the free ebook management tool, can convert FB2 to EPUB, MOBI, AZW3, PDF, and many other formats. This makes FB2 a good intermediate format if you need to distribute to multiple platforms.