Shared Typst formatting assets for NIH-style grant documents. Intended to be used as a git submodule.
git submodule add git@github.com:BonhamLab/assets_grants_common assets/grants_commonIn your Typst document, import and apply the NIH template:
#import "/assets/grants_common/lib.typ": *
#show: nih-formatCompile with --root . so that absolute imports resolve from the project root:
typst compile --root . main.typ grant.pdf
typst watch --root . main.typ grant.pdfTo "export" a version that contains the current commit hash:
typst compile --root . main.typ ~/Downloads/(basename $PWD)-(git rev-parse --short HEAD).pdf- Page: US Letter (8.5″ × 11″), 0.5″ margins on all sides
- Font: Liberation Serif, 11 pt
- Paragraphs: justified, single-spaced
- Headings: all at 11 pt per NIH rules — bold (h1), bold italic (h2), italic (h3+)
Pass page: or text: dicts to override specific fields:
#show: nih-format.with(
page-overrides: (margin: 0.75in),
text-overrides: (size: 12pt),
)The exported dicts nih-page and nih-text can also be spread directly into set rules if you need more control:
#import "/assets/grants_common/lib.typ": nih-page, nih-text
#set page(..nih-page, margin: (left: 1in))
#set text(..nih-text)github_workflows/release.yml is a template workflow for consumer repos. Copy it into your repo:
cp assets/grants_common/github_workflows/release.yml .github/workflows/release.ymlThe workflow triggers on GitHub release creation (or manually). It:
- Checks out all submodules recursively (including
assets/grants_common) - Installs Liberation Serif via
aptand Typst 0.14 - Compiles
main.typ→grant.pdfwith--root . - Creates a source archive (with all submodule contents) and SHA256 checksums
- Uploads
grant.pdf, the source.tar.gz, andchecksums.sha256to the GitHub release
Release artifacts are named after the repository (e.g., my-grant-v1.0.0-source.tar.gz).
- Typst 0.14
- Liberation Serif font installed (available in most Linux distros via
fonts-liberation)