63 lines
1.2 KiB
Typst
63 lines
1.2 KiB
Typst
// Style conf function for CHIBI PC-09 projects
|
|
#let conf(
|
|
title: none,
|
|
subtitle: none,
|
|
author: none,
|
|
doc,
|
|
) = {
|
|
|
|
// Global page format
|
|
set page(
|
|
paper: "us-letter",
|
|
header: align(right, text(10pt, weight: "light")[#title]),
|
|
numbering: "1",
|
|
)
|
|
|
|
// Font settings
|
|
set text(
|
|
font: "New Computer Modern",
|
|
size: 12pt,
|
|
)
|
|
|
|
// Default paragraph settings
|
|
set par(
|
|
justify: true,
|
|
first-line-indent: 1cm,
|
|
)
|
|
|
|
// Heading numbering
|
|
set heading(numbering: "1.1")
|
|
|
|
// Show table captions above tables
|
|
show figure.where(kind: table): set figure.caption(position: top)
|
|
|
|
// Title page and TOC
|
|
page(header: none, footer: none)[
|
|
// Emit title and subtitle page
|
|
#block(height: 60%)[
|
|
#align(center + horizon,
|
|
block(text(22pt)[#title]) +
|
|
block(above: 2em)[#smallcaps[#subtitle]] +
|
|
block[Written by #author],
|
|
)
|
|
]
|
|
// Emit TOC
|
|
#pagebreak()
|
|
#outline()
|
|
#pagebreak()
|
|
]
|
|
|
|
// Heading formatting for doc, must come after title page and TOC
|
|
show heading: it => [
|
|
CHAPTER
|
|
#counter(heading).display()
|
|
#it.body
|
|
]
|
|
|
|
// Emit doc
|
|
counter(page).update(1) // Reset counter for first real page
|
|
set align(left)
|
|
doc
|
|
}
|
|
|