refactor, document → report, option to underline headings
This commit is contained in:
parent
7de1d44e9d
commit
e2e4d39b80
5 changed files with 21 additions and 15 deletions
10
README.md
10
README.md
|
|
@ -13,15 +13,15 @@ typship download -n local https://imsc.uni-graz.at/git/gjankowiak/typst-uniforli
|
|||
#### Manually
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.local/share/typst/packages/local/uniforlife-document/
|
||||
cd ~/.local/share/typst/packages/local/uniforlife-document/
|
||||
curl https://imsc.uni-graz.at/git/gjankowiak/typst-uniforlife-template/archive/0.0.1.tar.gz | tar zx --xform 's/typst-uniforlife-document/0.0.1/'
|
||||
mkdir -p ~/.local/share/typst/packages/local/uniforlife-report/
|
||||
cd ~/.local/share/typst/packages/local/uniforlife-report/
|
||||
curl https://imsc.uni-graz.at/git/gjankowiak/typst-uniforlife-template/archive/0.0.2.tar.gz | tar zx --xform 's/typst-uniforlife-report/0.0.2/'
|
||||
```
|
||||
|
||||
## Quickstart (CLI)
|
||||
|
||||
```sh
|
||||
typst init @local/uniforlife-document document
|
||||
typst init @local/uniforlife-report report
|
||||
```
|
||||
|
||||
Tested typst version: `0.14.0`.
|
||||
Tested typst version: `0.15.0`.
|
||||
|
|
|
|||
BIN
src/lib.pdf
BIN
src/lib.pdf
Binary file not shown.
15
src/lib.typ
15
src/lib.typ
|
|
@ -3,7 +3,7 @@
|
|||
#let yellow = rgb(255, 243, 0, 100)
|
||||
#let darkyellow = rgb(255, 213, 00, 150)
|
||||
|
||||
#let document(
|
||||
#let report(
|
||||
title: [Title],
|
||||
task: [Task],
|
||||
university: [Universität Graz],
|
||||
|
|
@ -16,14 +16,21 @@
|
|||
logo: "logo_uniforlife.svg",
|
||||
lang: "de",
|
||||
smallcaps_headings: true,
|
||||
underline_headings: false,
|
||||
|
||||
body
|
||||
) = {
|
||||
let doublerule = [#set text(1pt, bottom-edge: "descender")
|
||||
#line(length: 100%, stroke: darkyellow+2pt)#line(length: 100%, stroke: luma(150)+1pt)
|
||||
]
|
||||
if smallcaps_headings {
|
||||
show heading: smallcaps
|
||||
|
||||
show heading.where(level: 1): it => {
|
||||
let heading_text = if smallcaps_headings {smallcaps(it)} else {it}
|
||||
if underline_headings {
|
||||
block(stroke: (bottom: darkyellow+0.2em), inset: (bottom: 0.05em))[#heading_text]
|
||||
} else {
|
||||
heading_text
|
||||
}
|
||||
}
|
||||
|
||||
show link: it => underline(stroke: yellow+0.2em, offset: 0.15em, evade: false, background: true)[#it]
|
||||
|
|
@ -63,7 +70,7 @@ set par(spacing: leading, leading: leading, first-line-indent: 2em, justify: tru
|
|||
set text(top-edge: 0.7em, fontsize, lang: lang)
|
||||
|
||||
v(-0.5cm)
|
||||
align(center)[#text(1.1em)[#underline(stroke: darkyellow+0.5em, extent: 0.1em, offset: 0.05em, evade: false, background: true)[#smallcaps([=== *#title*])]]]
|
||||
align(center)[#text(1.1em)[#underline(stroke: darkyellow+0.3em, extent: 0.1em, offset: 0.05em, evade: false, background: true)[#smallcaps([#heading(numbering: none, outlined: false, level: 2)[*#title*]])]]]
|
||||
v(0.5cm)
|
||||
|
||||
body
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#import "@local/uniforlife-document:0.0.1": document
|
||||
#import "@local/uniforlife-document:0.0.2": report
|
||||
|
||||
#document(
|
||||
#report(
|
||||
title: [Antigravity cuisine],
|
||||
task: [Recipe for fried eggs],
|
||||
university: [University of Graz],
|
||||
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#lorem(200)
|
||||
|
||||
|
||||
// #bibliography("refs.bib")
|
||||
]
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "uniforlife-document"
|
||||
version = "0.0.1"
|
||||
name = "uniforlife-report"
|
||||
version = "0.0.2"
|
||||
entrypoint = "src/lib.typ"
|
||||
authors = ["Gaspard Jankowiak"]
|
||||
license = "MIT"
|
||||
|
|
@ -13,4 +13,4 @@ compiler = "0.14.0"
|
|||
|
||||
[template]
|
||||
path = "template"
|
||||
entrypoint = "document.typ"
|
||||
entrypoint = "report.typ"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue