Skip to content

BonhamLab/template_grant

Repository files navigation

Grant Template

full|release full|dev aims|release aims|dev

Specific Aims preview

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).

Using this template

  1. Click Use this template → Create a new repository on GitHub.

  2. 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
  3. Update the badge URLs and image URL at the top of this README to use your username and repo name.

  4. Copy the CI workflow into place:

    mkdir -p .github/workflows
    cp assets/grants_common/github_workflows/release.yml .github/workflows/release.yml

Writing the grant

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

Exporting individual sections

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))

Building locally

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

Releases and PDF builds

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"

Private submodules

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

  1. go to https://github.com/settings/apps
  2. Select personal access token -> Fine-grained tokens
  3. Create new token (or edit existing one).
    • it needs to have "content: read-only" permission
  4. Give that token permission for your code repo.
  5. Update the release.yml and preview.yml workflows to use whatever you named it (in place of SUBMODULE_PAT)

About

NIH grant template for typst-generated documents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors