2025-09-02

Exporting Logseq Flashcards to PDF with Typst

Logseq’s built‑in flashcards let you create spaced‑repetition items directly inside your notes using simple blocks and quick commands. To create a flashcard, begin by adding the tag #card at the start of the block, followed by a progressive number. On the same line, write your question. Then, on the next line, indent the answer using a tab.

    #card 1 What does HTML stand for?
        HyperText Markup Language

In this example, #card 1 indicates the first flashcard, followed by the question. On the next line, we can define the answer, indented with a tab. For cloze deletions, use the /cloze command inside that tagged block.

Please note that the built-in Logseq flashcards feature may or may not be enabled. Check if the feature is enabled by navigating to Settings - Features, as shown in the figure below.

For users who prefer printable or shareable study sets, exporting those flashcards to PDF is common. Typst, a modern typesetting language focused on clear, repeatable layouts, offers a powerful way to turn Logseq flashcards into PDFs.

As shown in the video below, we developed a Python script — that collects flashcards from your Logseq graph and saves them into a Typst-compatible data structure.

This Python script requires modules only from the standard library and can be run locally after downloading from https://buymeacoffee.com/seve/gallery/3984610, or you can use pipx directly from the same URL.

At the same URL you’ll also find a simple Typst document that imports the data structure and produces printable 6×4‑inch flashcards. Use the command line to generate the flashcards with the following command:

   typst.exe c flashcards.typ flashcards.pdf

If you regularly use PowerShell Core or Desktop, we recommend integrating a recent version of the Vim editor (version 9 or higher) with our plugin for an enhanced editing experience, and integrated LSP.

Finally, don’t forget to check our Index Card Notebook — a compact pen‑and‑paper solution that complements your digital flashcards or can be used standalone.

Flash Card Notebook