typst-templates/README.md

72 lines
1.4 KiB
Markdown
Raw Normal View History

2023-04-18 19:59:45 -04:00
# typst templates
2023-04-18 20:05:28 -04:00
Personal templates for [Typst](https://github.com/typst/typst), a neat markdown-like typsetting system.
2023-04-18 19:59:45 -04:00
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
2023-04-18 19:59:45 -04:00
Example usage (this is test.typ in the above tree:)
```typ
#import "/templates/problems.typ": template, source_code, status
2023-04-18 19:59:45 -04:00
#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.
2023-04-18 20:05:28 -04:00
Some settings are available in `main.typ`.
2023-05-20 13:21:07 -04:00
## Screenshots
![preview](https://raw.githubusercontent.com/dogeystamp/typst-templates/master/preview.jpg)