A lightweight Emacs minor mode to help author Org-mode documents for the A101 pagemaker (Typst) pipeline.
It provides:
- Build commands for Typst (
.typ) and PDF via thepagemakerCLI - Validation and watch workflows with clickable error locations
- An IR viewer to inspect the intermediate JSON
- Font helpers (list, install, validate, search, analyze, specimen)
- Interactive template inserters for documents, pages, and elements
Repository: https://github.com/sanderboer/org-pagemaker
- Emacs >= 27.1
- Org >= 9.3
- Pagemaker CLI available:
- Either the
pagemakerexecutable on yourPATH, or the Python modulepagemaker.cliavailable in your project.
- Either the
- Typst installed and on
PATHfor PDF builds - Python 3 (only needed when invoking
python -m pagemaker.cli)
Note: When the pagemaker binary is not found (or you disable it), the mode runs python -m pagemaker.cli and automatically augments PYTHONPATH with the project’s src/ folder (project root is detected by pyproject.toml or .git).
Basic recipe:
(straight-use-package
'(org-pagemaker :type git
:host github
:repo "sanderboer/org-pagemaker"))Explicit branch and file layout (robust for the lisp/ layout):
(straight-use-package
'(org-pagemaker :type git
:host github
:repo "sanderboer/org-pagemaker"
:branch "main"
:files ("lisp/*.el")))With use-package:
(use-package org-pagemaker
:straight (org-pagemaker :type git
:host github
:repo "sanderboer/org-pagemaker"
:branch "main"
:files ("lisp/*.el"))
:hook (org-mode . org-pagemaker-mode))- Clone the repo and add the
lisp/directory to yourload-path:
(add-to-list 'load-path "/path/to/org-pagemaker/lisp/")
(require 'org-pagemaker)- Open an
.orgfile in your project. - Enable the mode:
M-x org-pagemaker-mode(or add to yourorg-mode-hook). - Build PDF with
C-c p p. The output goes intoexport/by default. - Use
C-c p oto open the last PDF for the current Org file.
The mode displays build/validate/watch buffers in compilation-mode by default; Typst-style error messages become clickable.
-
Builds
C-c p b: Build Typst (org-pagemaker-build)C-c p p: Build PDF (org-pagemaker-pdf)C-c p v: Validate assets (org-pagemaker-validate)C-c p w: Watch (Typst or PDF withC-u) (org-pagemaker-watch)C-c p s: Stop watch (org-pagemaker-stop-watch)C-c p o: Open last PDF (org-pagemaker-open-last-pdf)C-c p i: IR viewer (org-pagemaker-ir)
-
Templates
C-c p t d: Insert document header (org-pagemaker-insert-document-template)C-c p t p: Insert page (org-pagemaker-insert-page)C-c p t e: Insert element (org-pagemaker-insert-element)
-
Fonts
C-c p f l: List installed fonts (org-pagemaker-fonts-list) —C-ufor detailsC-c p f i: Install font (org-pagemaker-fonts-install) — prompt for family, variantsC-c p f v: Validate font availability (org-pagemaker-fonts-validate) —C-ufor detailsC-c p f s: Search Google Fonts (org-pagemaker-fonts-search) —C-ufor detailsC-c p f a: Analyze current document’s fonts (org-pagemaker-fonts-analyze) —C-ufor detailsC-c p f p: Generate specimen (org-pagemaker-fonts-specimen) —C-ufor PDF,C-u C-uto choose type
- Most build commands accept a prefix (
C-u) to prompt for additional options (e.g., export dir, filenames). org-pagemaker-watchwithC-ualso builds PDFs on changes.org-pagemaker-fonts-specimenwithC-u C-uprompts for specimen type (showcase,comparison,simple).
Customize via M-x customize-group RET org-pagemaker RET:
org-pagemaker-export-dir(default:export): Output location for buildsorg-pagemaker-typst-output(default:deck.typ): Typst filenameorg-pagemaker-pdf-output(default: nil): Optional explicit PDF output nameorg-pagemaker-prefer-cli-binary(default: t): Preferpagemakerexecutableorg-pagemaker-python-executable(default:python3): Used when falling back to moduleorg-pagemaker-sanitize-pdfs(default: nil): Pass--sanitize-pdfsto PDF/watchorg-pagemaker-validate-fonts(default: nil): Pass--validate-fontsto build/pdforg-pagemaker-strict-fonts(default: nil): Pass--strict-fontsto build/pdforg-pagemaker-use-compilation-mode(default: t): Enable clickable errors
When org-pagemaker-use-compilation-mode is enabled, build/validate/watch buffers use compilation-mode and add Typst-style error patterns:
- Clicking on
--> file.typ:line:coljumps to the location. - Standard
next-error/previous-errorworks (M-g n/M-g p).
The mode derives the project root by looking for pyproject.toml or .git (fallback to the current file’s directory). This is used to:
- Set the working directory for CLI commands
- Infer
PYTHONPATHto includesrc/when usingpython -m pagemaker.cli
The legacy pagemaker-el package name is still available as a shim that forwards all commands and variables to org-pagemaker. Move to org-pagemaker-* names when convenient.
- Ensure Typst and
pagemakerare available on yourPATHif you want to use the binary. Otherwise, the mode falls back topython -m pagemaker.cli. - If
watchsays a process is already running, useC-c p sto stop it. - Fonts commands rely on the CLI; network is required for searching and installing from Google Fonts.
Issues and PRs welcome at https://github.com/sanderboer/org-pagemaker.