Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHESPTRUFRDEEN

Elysia Tools

Navigation

Media

Typst sample: bytes, raw code and table markup

Inspect UTF-8 text and distinguish displayed source examples from document markup.

Samples

Entries inside this sample collection

FileSimple

Sample Typst

A Typst sample for in-browser preview

Difficulty

1/10

Tags

typst

sample.typ

TYP · 837 B

Download fileOpen in new tab
fileSize
837
format
Typst
extension
.typ

Tools

Tools frequently paired with this sample

Related

Related sample collections

Related

Related workflows

Tool usage guide

Sample-focused context for search and workflow understanding

Overview

Download sample.typ and open it as text. This fixture combines headings, two equations, a fenced code example and a price table. These checks inspect the source offline; they do not compile it or verify a rendered PDF.

Reading context

The sample card provides file actions, not proof that the document has rendered. A pagebreak declaration alone does not establish the final number of PDF pages.

How it works

  1. 1Sample Typst · Download file / Open in new tab
  2. 2Download first, then run the three Python snippets in order in the same local session. They read the source as data, not as Typst code.

Edge cases & common failures

  • Scope

    The included Python checks recognize this fixed fixture, not all Typst syntax. No imports, compiler, document execution, fonts or external resources are loaded. Rendering and PDF export remain unverified.

Examples

1. Explain the UTF-8 byte count

How to use

Sample Typst: Read the file as bytes, decode UTF-8, then count Unicode code points and non-ASCII characters. Compare newline bytes separately.

from pathlib import Path
from collections import Counter
b = Path("sample.typ").read_bytes()
assert len(b) == 837
text = b.decode("utf-8")
print(len(b), len(text))
print(Counter(c for c in text if ord(c) > 127))
print(b.startswith(b"\xef\xbb\xbf"), b.count(b"\n"), b.count(b"\r"))

Outcome

The exact file has 837 bytes and 829 code points. Its four em-dashes each use 3 UTF-8 bytes, explaining the 8-byte difference. There is no BOM, with 47 LF bytes and no CR bytes. Code points are not a general measure of rendered glyphs or lines.

2. Separate raw examples from active markup

How to use

Sample Typst: Locate the single triple-backtick block tagged typst. Exclude that block before counting heading lines and #set declarations.

import re
blocks = re.findall(r"^```typst\n(.*?)^```$", text, re.M | re.S)
assert len(blocks) == 1
outside = re.sub(r"^```typst\n.*?^```\n", "", text, flags=re.M | re.S)
headings = re.findall(r"^(=+) (.+)$", outside, re.M)
print(sum(level == "=" for level, _ in headings), sum(level == "==" for level, _ in headings))
print(len(re.findall(r"^#set ", blocks[0], re.M)), len(re.findall(r"^#set ", outside, re.M)))
print(outside.count("#pagebreak()"))

Outcome

The block contains two #set examples for A4 and 11pt plus = Hello World. They are raw displayed code, not page/text settings or a document heading. Outside it are 2 level-one and 4 level-two headings, no #set rules, and one #pagebreak() declaration. Do not infer A4, 11pt or exactly two rendered pages from this source.

3. Check table cells and escaped currency

How to use

Sample Typst: Outside the raw block, find #table with columns: 3. Count bracketed cell entries and distinguish escaped currency dollar signs from math delimiters.

table = outside.split("#table(", 1)[1]
assert re.search(r"columns:\s*3", table)
cells = re.findall(r"\[([^\]]*)\]", table)
math_regions = re.findall(r"(?<!\\)\$(.*?)(?<!\\)\$", outside, re.S)
print(len(cells), len(cells) // 3)
print(outside.count("\\$"), len(math_regions))

Outcome

There are 12 cell entries: 3 header cells and 9 data cells, forming 4 logical rows. The three prices each use an escaped dollar sign, while the document has two separate math regions. Currency markers do not create three extra equations. This is source structure, not a measured table layout.

FAQ

Does the typst code-fence label execute its contents?

No. In Typst raw syntax the language label supports highlighting; the fenced text is displayed as code rather than evaluated as document markup.

Hub

Infer JSON Schema from Samples and Spreadsheets

Derive a reviewable JSON Schema draft from representative JSON samples or XLSX rows, then inspect types, requiredness, nulls, and outliers before treating it as a contract.

Hub

Stream Copy, Remux, and Media Packaging

Inspect streams, remux containers, trim by timestamp, mux tracks, softmux subtitles, embed cover art, and batch rewrap media while preserving source quality.

Hub

One Photo to a Platform-Ready Social Media Image Kit

Turn a single master photo into correctly sized crops for Instagram, TikTok, LinkedIn, and X, preview caption-safe zones, build split grids and collages, and add clearly named styled variants when the channel voice allows them.

Hub

Podcast Episode Audio and RSS Publication Preflight

Check one finished podcast episode against its RSS entry, verify final-file size, type and duration, and separately test public media access and player behavior before publication.

Home
Tools3215
Samples593
Visualizations472
Viewers103
Hubs239
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance647

Calculators, numerics, date logic, statistics, and finance tools

Design & Color298

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web194

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

Lead Generation Quiz Launch and Contact Handoff
Memorial Drafts: Family Review and Print Handoff
Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact

Media

Batch Image Info Viewer

View basic information for multiple images at once - dimensions, format, file size, and metadata presence

Media

Batch EXIF Viewer

View EXIF metadata from multiple images at once

Media

3D Model Viewer & Inspector

Upload an STL, OBJ, GLB or glTF model: exact vertex/triangle counts, bounding-box dimensions, materials, animations and node tree, plus an interactive Three.js viewer (rotate, zoom, shaded/wireframe/normals).

Media

Audio Metadata Viewer

View all metadata tags of an audio file

Development

Hex Editor (File Viewer)

Upload any binary file and inspect it as a classic hex dump with offset, hex bytes, and ASCII columns (read-only)

Development

Game Save Viewer

Drop any game save file — Minecraft NBT, Unreal Engine GVAS, Palworld containers, JSON/XML/INI/Lua text saves, SQLite profiles — and get the detected format, engine versions, key progress fields and a bounded structural tree.

Document Tools

PDF Code Snippet Viewer

Render code snippets with mono font, background boxes, and clickable Git repository links

Media

Audio Preview Snippets

Generate short preview snippets from multiple timestamps

Media

VTT Subtitle Samples

Sample WebVTT subtitle files from simple to complex for subtitle previews, parser testing, conversion, and note handling

Media

ASS Subtitle Samples

Sample ASS subtitle files from simple to complex for style-aware subtitle parsing, translation, conversion, and localization QA

Media

SRT Subtitle Samples

Sample SRT subtitle files from simple to complex for testing import, translation, conversion, and timing-preservation workflows

Media

3DS Viewer Samples

A 3DS 3D model sample for in-browser preview

Media

3MF Viewer Samples

A 3MF 3D model sample for in-browser preview

Media

AI Viewer Samples

An Illustrator AI sample for in-browser preview