Expert in Typst dual-format content system for FINMA project...
You are an expert in the FINMA Content Management dual-format Typst system. This project uses a sophisticated architecture where a single content file can be rendered as either a presentation (slides) or a document (study guide).
The project uses three key files that work together:
dual_format.typ - The orchestration layer
content-block() that adapts to modepresentation_functions.typ - Slide creation functions
slide(), title-slide(), section-slide()two-column-grid(), two-by-two-grid(), three-column-grid()two-row-grid(), three-row-grid()make-table() for formatted tablesdocument_functions.typ - Study guide functions
section-heading(), formula-block()concept-box(), example-box(), definition-box()takeaways-box(), examples-box()Every content file follows this pattern:
#import "../dual_format.typ": *
#document-only[
#pagebreak()
#outline()
]
#section("Introduction")
#content-block(
title: "Concept Name",
subtext: "Brief description shown under title",
center: false, // true for centered layout, false for top-aligned
summary: [
// Content shown in PRESENTATION mode
#two-row-grid(
[ First section content ],
[ Second section content ]
)
],
details: [
// Additional content for DOCUMENT mode only
],
examples: [
// Examples shown on separate slide in presentations
// Shown in orange box in documents
]
)
content-block() - The main content function
title: - Section titlesubtext: - Subtitle text (shown under title line)center: - Boolean, whether to vertically center content in presentationssummary: - Content for presentation slides (and documents)details: - Additional content for documents onlyexamples: - Examples (separate slide in presentations, orange box in documents)Behavior:
center parameter), creates separate examples slide if examples providedGrid Layouts:
#two-column-grid(left, right, col-height: 1)
#two-row-grid(top, bottom, row-height: 1)
#two-by-two-grid(top-left, top-right, bottom-left, bottom-right)
#three-column-grid(left, middle, right)
#three-row-grid(top, middle, bottom)
Table Builder:
#make-table(
columns: (1fr, 1fr, 1fr),
row-height: (auto, 1fr, 1fr), // Can be auto, 1fr, or array
header-fills: (rgb("#384d81"), rgb("#384d81"), rgb("#384d81")),
header-styles: (("Title", "subtitle"), ("Title", "subtitle"), ...),
body-content: (
([ content ], [ content ], [ content ]), // Row 1
([ content ], [ content ], [ content ]), // Row 2
),
border-color: gray,
border-width: 0.5pt,
)
#section("Section Name") // Adapts to mode automatically
// In presentations: Creates section divider slide
// In documents: Creates heading with blue line
#presentation-only[ /* content only in slides */ ]
#document-only[ /* content only in study guides */ ]
#both-formats(
/* presentation content */,
/* document content */
)
FINMA_Content_Management/
āāā .claude/
ā āāā skills/ # ā Project-specific skills go here
āāā dual_format.typ # Main orchestration file
āāā presentation_functions.typ
āāā document_functions.typ
āāā test_templates/
ā āāā images/
ā āāā equity_research_content.typ # Example content file
ā āāā equity_research_document.typ # Document driver
ā āāā equity_research_slide.typ # Presentation driver
āāā cropped_FINMA_logo.png
āāā finma_bg_1.png
āāā README.md
Create content.typ with your content using the dual-format structure:
#import "../dual_format.typ": *
#document-only[
#pagebreak()
#outline()
]
#section("Your Section")
#content-block(
title: "Your Topic",
subtext: "Brief description",
center: false,
summary: [
// Main content with layout functions
],
examples: [
// Optional examples
]
)
Create presentation.typ:
// Equity Research - Presentation Driver
// This file renders equity_research.typ in slide presentation format
#import "../dual_format.typ": *
// Set presentation mode and page format
#set page(
width: 29.7cm,
height: 20.999cm,
margin: 0in,
flipped: false,
footer: [
#align(right)[
#text(size: 18pt, fill: rgb("#0a0f14"))[
#context counter(page).display("1")
]
]
]
)
#set text(size: 12pt)
#set text(font: "Arial")
#set heading(numbering: none)
#set-mode("presentation")
// Presentation title slide
#title-slide(
title: "Financial Markets Academy (finma)",
subtitle: "Equity Research",
author: "August 2025"
)
// Set margin for all following slides
#set page(
width: 29.7cm,
height: 20.999cm,
margin: (x: 0.5in, y: 0.5in),
flipped: false,
header: [
#align(right + horizon)[
#v(0.78in)
#image("../cropped_FINMA_logo.png", height: 0.4in)
]
],
footer: [
// bottom divider line
#line(
length: 100%,
stroke: (paint: rgb("#609ed6"), thickness: 1.5pt)
)
#v(-0.2cm)
#align(right)[
#text(size: 12pt, fill: rgb("#0a0f14"))[
#context counter(page).display("1")
]
]
]
)
#include "equity_research_content.typ"
Create document.typ:
// Week 2 Option Pricing - Document Driver (Study Guide)
// This file renders Week_2_Content.typ in long-form document format
#import "../dual_format.typ": *
// Set document mode and page format
#set page(
paper: "a4",
margin: (top: 0.7in, right: 0.7in, bottom: 0.7in, left: 0.7in),
footer: [
#v(0.1in)
// line across the footer area
#line(length: 100%)
// space after the line
#v(-6pt)
// footer text aligned right
#align(center)[
#text(size: 12pt)[#context counter(page).display("1")]
]
],
header: [
// Three equally spaced columns
#text(size: 10pt)[
#grid(
columns: 3,
gutter: 1fr, // spreads them evenly
[
FINMA
],
[
Week 2: Option Pricing Study Guide
],
[
August 2, 2025
]
)
]
#v(-10pt)
#line(length: 100%)
#v(0.2in)
],
)
#set text(size: 12pt)
#set heading(numbering: "1.")
#set par(justify: true)
#set-mode("document")
// Document title and metadata
#page(
margin: (top: 2in),
header: [
#align(right)[#image("../cropped_FINMA_logo.png", height: 0.3in)]
#v(0.9in)
],
footer: none,
)[
#align(center)[
#text(size: 18pt, weight: "bold")[Week 2: Option Pricing Study Guide]
#v(0.5em)
#text(size: 14pt)[Black-Scholes Model and Greeks]
#v(0.5em)
#text(size: 12pt)[Derivatives Course - Financial Markets Academy]
#v(0.5em)
#text(size: 11pt)[August 2, 2025]
]
]
// Include the course content
#include "equity_research_content.typ"
# Compile presentation
typst compile presentation.typ
# Compile document
typst compile document.typ
# Watch for changes (auto-recompile)
typst watch presentation.typ
Always use content-block() for main content
center: false for content-heavy slidescenter: true for simple concept slidesUse layout functions inside summary blocks
two-column-grid() for side-by-side contenttwo-row-grid() for top/bottom layoutstwo-by-two-grid() for 2x2 layoutsImages in grids
#two-column-grid(
[
Text content here
],
[
#box(width: 100%, height: 100%)[
#align(center + horizon)[
#image("images/your-image.png")
]
]
]
)
Examples are always separate
examples-box()Use document-only for outlines
Common Issues:
Content not appearing
#set-mode("presentation") or #set-mode("document")#import "../dual_format.typ": *Slide overflow
center: false parametercontent-block() callsGrid alignment issues
box(width: 100%, height: 100%) to fill grid cellsalign(center + horizon) for centered content in cellsTable formatting
(auto, 1fr, 1fr) for variable heightsUsing $ signs
\$ insteadFrom presentation_functions.typ:
blue = rgb("#1f4e79")green = rgb("#006d8f")red = rgb("#c5504b")gray = rgb("#595959")Additional colors used:
#make-table(
columns: (1fr, 1fr, 1fr),
row-height: (auto, 1fr, 1fr),
header-fills: (rgb("#384d81"), rgb("#384d81"), rgb("#384d81")),
header-styles: (
("Feature", ""),
("Labour Intensive", ""),
("Capital Intensive", "")
),
body-content: (
(
[Main cost type
- Labor wages
- Training costs],
[- Variable labor costs
- High turnover],
[- Equipment
- Facilities
- Technology]
),
(
[Scalability
- Harder to scale
- Linear growth],
[- Hire more people
- Time-intensive],
[- Easier to scale
- Upfront investment]
)
)
)
For very long content, create multiple content blocks:
#content-block(
title: "Topic Part 1",
center: false,
summary: [ /* First part */ ]
)
#content-block(
title: "Topic Part 2",
center: false,
summary: [ /* Second part */ ]
)
When working on FINMA content:
Before finalizing content: