Typst template for NIH-style grant documents. Uses Liberation Serif and enforces NIH formatting rules (US Letter, 0.5″ margins, 11 pt, justified text, heading styles).
-
Click Use this template → Create a new repository on GitHub.
-
Clone your new repo and initialize the formatting submodule:
git clone --recurse-submodules git@github.com:YOUR-USERNAME/YOUR-REPO
Or if already cloned:
git submodule update --init --recursive
-
Update the badge URLs and image URL at the top of this README to use your username and repo name.
-
Copy the CI workflow into place:
mkdir -p .github/workflows cp assets/grants_common/github_workflows/release.yml .github/workflows/release.yml
Edit the .typ files directly. Each section is a separate file:
| File | Section |
|---|---|
main.typ |
Entry point — imports sections and applies NIH formatting |
aims-standalone.typ |
Additional entry point — preview of Aims only with formatting |
aims.typ |
Specific Aims |
approach.typ |
Research Strategy / Approach |
facillities.typ |
Facilities & Resources |
main.typ should import the NIH template and each section file:
#import "/assets/grants_common/lib.typ": *
#show: nih-format
== Specific Aimes
#include "aims.typ"
== Approach
#include "approach.typ"
== Facilities
#include "facilities.typ"Within a section file, use standard Typst markup:
Paragraph text goes here. *Bold*, _italic_, and @citation are supported.
To cite an author inline, you can say #cite(<reftag>, form: "prose")
said some thing.
== Aim 1: Short title
Description of the aim.
- Hypothesis: ...
- Approach: ...Heading levels provide the following formatting:
==-> All caps, bold===-> bold====→ underline, italic
For exporting individual sections (eg Specific Aims)
as standalone documents, create a section-standalone.typ
that imports the formatting components and just includes
the relevant section, eg
// aims-standalone.typ
#import "/assets/grants_common/lib.typ": *
#show: nih-format
= Specific Aims
#include "aims.typ"
#bibliography("refs.bib", title: none, style: "apa")If you need a different formatting, you can pass overrides to the format, or just set them after the fact:
#show: nih-format
#set page(margin: 0.75in)
// or
#show: nih-format.with(page-overrides: (margin: 0.75in))Requires Typst 0.14 and Liberation Serif (sudo apt-get install fonts-liberation or equivalent).
# Compile once
typst compile main.typ grant.pdf
# Watch for changes
typst watch main.typ grant.pdf
# export with current commit hash
# fish shell
typst compile main.typ ~/Downloads/(basename $PWD)-(git rev-parse --short HEAD).pdf
# bash/zsh
typst compile main.typ ~/Downloads/$(basename $PWD)-$(git rev-parse --short HEAD).pdf
Creating a GitHub release triggers the CI workflow to compile main.typ and *-standalone.typ,
attaching grant.pdf and *-standalone.pdf to the release.
To create a release:
gh release create v1.0 --title "submission draft" --notes "Initial submission draft"I often like to have code that generates figures in a separate repo. Sometimes that other repo is private. This is no problem, but if you want the github actions to work, you need to make sure the actions can see the other repos.
To do this, you need to generate a private access token
- go to https://github.com/settings/apps
- Select personal access token -> Fine-grained tokens
- Create new token (or edit existing one).
- it needs to have "content: read-only" permission
- Give that token permission for your code repo.
- Update the release.yml and preview.yml workflows to use whatever you named it (in place of
SUBMODULE_PAT)
