// Example 8: Accessibility - Alt Text #import "@preview/cetz:0.4.2" #set text(font: "Libertinus Serif", size: 11pt) #set page(paper: "a4", margin: 2cm) = Accessibility Features == Image with Alt Text Typst supports native alt text for images, making documents more accessible: #figure( box(width: 80%, cetz.canvas({ import cetz.draw: * rect((0, 4), (3, 5.5), fill: blue.lighten(70%), stroke: blue) content((1.5, 4.75), [Start], anchor: "center") rect((5, 4), (9, 5.5), fill: green.lighten(70%), stroke: green) content((7, 4.75), [Load Data], anchor: "center") rect((5, 1.5), (9, 3.5), fill: orange.lighten(70%), stroke: orange, radius: 0.3) content((7, 2.5), [Valid?], anchor: "center") rect((11, 4), (15, 5.5), fill: green.lighten(70%), stroke: green) content((13, 4.75), [Process], anchor: "center") rect((11, 0), (15, 1.5), fill: red.lighten(70%), stroke: red) content((13, 0.75), [Error Log], anchor: "center") rect((16, 4), (19, 5.5), fill: blue.lighten(70%), stroke: blue) content((17.5, 4.75), [End], anchor: "center") line((3, 4.75), (5, 4.75), mark: (end: ">"), stroke: black + 1pt) line((9, 4.75), (9, 2.5), mark: (end: ">"), stroke: black + 1pt) line((9, 2.5), (11, 4.75), mark: (end: ">"), stroke: black + 1pt) line((7, 1.5), (7, 0.75), mark: (end: ">"), stroke: black + 1pt) line((7, 0.75), (11, 0.75), mark: (end: ">"), stroke: black + 1pt) line((11, 0.75), (11, 4.75), mark: (end: ">"), stroke: black + 1pt) line((15, 4.75), (16, 4.75), mark: (end: ">"), stroke: black + 1pt) content((9.5, 2.5), [Yes], anchor: "west") content((7, 1.8), [No], anchor: "south") })), caption: [ Figure 1: Data Processing Pipeline - Flowchart showing the three-stage data processing workflow from input validation through transformation to output generation, with error handling at each stage. ], ) The image above demonstrates how alt text can be added to figures for screen reader accessibility. == Semantic Markup Typst encourages semantic tagging for better structure: #grid( columns: (1fr, 1fr), row-gutter: 1em, column-gutter: 1em, [ #strong[Strong emphasis] is used for important content. ], [ #emph[Emphasis] is used for subtle emphasis. ], [ #text(weight: "bold", fill: blue)[Custom] styling for specific purposes. ], [ #text(style: "italic")[Italic] for titles or foreign terms. ], ) == Structured Content #block( fill: rgb("#e8f4ea"), inset: 12pt, radius: 4pt, )[ *Key Takeaway:* Typst makes accessibility a first-class concern, not an afterthought. ]