typst-templates/README.md
dogeystamp 99fd8e3788
overhaul a lot of stuff
- added lref feature which links to files in the knowledge base without
  having to add ten million "../../../"
- instructions changed so that now you can link to
  "/templates/template.typ" without having to add ten million
  "../../../" to the path
2023-07-10 13:01:07 -04:00

1.4 KiB

typst templates

Personal templates for Typst, a neat markdown-like typsetting system.

I have the following directory structure for these:

docs/
├── problems
│   ├── src
│   │   └── test.cpp
│   ├── test.pdf
│   └── test.typ
└── templates
    └── ...

Installation

Set up docs/ as a git repo.

mkdir docs
cd docs
git init

Add templates/ as a submodule.

git submodule add https://github.com/dogeystamp/typst-templates templates

Set the environment variable TYPST_ROOT to docs/ in .bashrc, .profile or equivalent. Otherwise, templates won't be able to render due to security policy.

.profile
--------

export TYPST_ROOT="$HOME/docs"

Create a settings file in docs/:

templates/gensettings.sh settings.yml

Example usage

Example usage (this is test.typ in the above tree:)

#import "/templates/problems.typ": template, source_code, status
#show: template.with(
  title: "CCC '22 J1 - Cupcake Party",
  problem_url: "https://dmoj.ca/problem/cc22j1",
  stat: "incomplete",
)

= Thought process

#lorem(20)

== Important things

#lorem(50)

#source_code("test")

Fonts should be included in Typst itself.

Some settings are available in main.typ.

Screenshots

preview