Init: lab2 done
This commit is contained in:
1
docs/template/functions/code.typ
vendored
Normal file
1
docs/template/functions/code.typ
vendored
Normal file
@@ -0,0 +1 @@
|
||||
#let code = raw.with(block: true)
|
||||
79
docs/template/module.typ
vendored
Normal file
79
docs/template/module.typ
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
#import "functions/code.typ": code
|
||||
|
||||
#let default(
|
||||
title: "This is a title",
|
||||
authors: ((
|
||||
name: "Yi-Ting Shih",
|
||||
affiliation: "National Yang Ming Chiao Tung University",
|
||||
email: "ytshih@it.cs.nycu.edu.tw",
|
||||
),),
|
||||
content,
|
||||
) = {
|
||||
// Content default
|
||||
set page(
|
||||
paper: "a4",
|
||||
margin: (x: 1.8cm, y: 1.5cm),
|
||||
header: align(right, title),
|
||||
numbering: "1",
|
||||
)
|
||||
set text(
|
||||
font: "Libertinus serif",
|
||||
size: 10pt,
|
||||
)
|
||||
set par(
|
||||
leading: 0.6em,
|
||||
)
|
||||
|
||||
// Heading default
|
||||
show heading: set text(
|
||||
font: "Noto sans",
|
||||
)
|
||||
|
||||
// Section title default
|
||||
show heading.where(level: 1): set heading(
|
||||
numbering: "1."
|
||||
)
|
||||
|
||||
// Raw default
|
||||
show raw: set text(
|
||||
font: "Consolas",
|
||||
size: 8pt,
|
||||
)
|
||||
// Code section default
|
||||
show raw.where(block: true): self => {
|
||||
block(
|
||||
fill: luma(240),
|
||||
inset: 8pt,
|
||||
radius: 2pt,
|
||||
self
|
||||
)
|
||||
}
|
||||
|
||||
{ // Title
|
||||
set align(center)
|
||||
set text(
|
||||
size: 20pt,
|
||||
weight: "bold",
|
||||
)
|
||||
pad(y: 10pt, title)
|
||||
}
|
||||
|
||||
{ // author
|
||||
set align(center)
|
||||
set text(
|
||||
size: 10pt,
|
||||
)
|
||||
let count = authors.len()
|
||||
let ncols = calc.min(count, 3)
|
||||
grid(
|
||||
columns: (1fr,) * ncols,
|
||||
row-gutter: 24pt,
|
||||
..authors.map(author => [
|
||||
#author.name \
|
||||
#author.affiliation \
|
||||
#link("mailto:" + author.email)
|
||||
]),
|
||||
)
|
||||
}
|
||||
content
|
||||
}
|
||||
Reference in New Issue
Block a user