added: outline
This commit is contained in:
parent
381e8d5d42
commit
26f947a0d3
Binary file not shown.
After Width: | Height: | Size: 244 KiB |
|
@ -5,4 +5,31 @@
|
|||
|
||||
= Lorem Ipsum
|
||||
|
||||
#lorem(50)
|
||||
#lorem(25)
|
||||
|
||||
#lorem(100)
|
||||
|
||||
== Lorem Ipsum 2
|
||||
|
||||
#lorem(200)
|
||||
|
||||
= Lorem Ipsum 3
|
||||
|
||||
#lorem(15)
|
||||
|
||||
$ integral_2^8 4x^2 $
|
||||
|
||||
#figure(image("digitaldog.jpg", height: 480pt), caption: [ Some image caption ])
|
||||
|
||||
#figure(
|
||||
table(
|
||||
columns: 2,
|
||||
"Hello", "World"),
|
||||
caption: [ Some table ])
|
||||
|
||||
#figure(
|
||||
```rust
|
||||
fn main() -> {
|
||||
|
||||
}
|
||||
```, caption: [Some code])
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
#let new_abstract(thesis) = context [
|
||||
|
||||
#pagebreak(weak: true)
|
||||
#align(center + horizon)[
|
||||
#if text.lang == "de" [
|
||||
= Zusammenfassung
|
||||
|
||||
#thesis.summary
|
||||
]
|
||||
|
||||
#pagebreak(weak: true)
|
||||
= Abstract
|
||||
|
||||
#thesis.abstract
|
||||
]
|
||||
]
|
|
@ -3,6 +3,7 @@
|
|||
thesis,
|
||||
author) = context [
|
||||
|
||||
#v(2em)
|
||||
#if text.lang == "de" [
|
||||
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Sperrvermerk")
|
||||
] else if text.lang == "en" [
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#let new_declaration_of_authorship(thesis, author) = context [
|
||||
|
||||
#v(2em)
|
||||
#if text.lang == "de" [
|
||||
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Selbständigkeitserklärung")
|
||||
] else if text.lang == "en" [
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
// render an outline of figures
|
||||
// with a specific title and filter by a specifc kind of figure
|
||||
// can optionally insert a pagebreak after the outline
|
||||
// NOTE: will not render in case the listing is empty
|
||||
#let render_filtered_outline(title: str, kind: selector) = context {
|
||||
let elems = query(figure.where(kind: kind), here())
|
||||
let count = elems.len()
|
||||
|
||||
// only show outline if there is something to list
|
||||
if count > 0 {
|
||||
pagebreak(weak: true)
|
||||
outline(
|
||||
title: heading(level: 3, title),
|
||||
target: figure.where(kind: kind))
|
||||
}
|
||||
}
|
||||
|
||||
#let render_figures_outline() = context {
|
||||
let title = if (text.lang == "de") {
|
||||
"Abbildungsverzeichnis"
|
||||
} else if text.lang == "en" {
|
||||
"List of Figures"
|
||||
}
|
||||
|
||||
render_filtered_outline(title: title, kind: image)
|
||||
}
|
||||
|
||||
#let render_table_outline() = context {
|
||||
let title = if (text.lang == "de") {
|
||||
"Tabellenverzeichnis"
|
||||
} else if text.lang == "en" {
|
||||
"List of Tables"
|
||||
}
|
||||
|
||||
render_filtered_outline(title: title, kind: table)
|
||||
}
|
||||
|
||||
#let render_raw_outline() = context {
|
||||
let title = if (text.lang == "de") {
|
||||
"Quelltextverzeichnis"
|
||||
} else if text.lang == "en" {
|
||||
"Code Snippets"
|
||||
}
|
||||
|
||||
render_filtered_outline(title: title, kind: raw)
|
||||
}
|
||||
|
||||
#let render_heading_outline() = context {
|
||||
let title = if (text.lang == "de") {
|
||||
"Inhaltsverzeichnis"
|
||||
} else if text.lang == "en" {
|
||||
"Table of Contents"
|
||||
}
|
||||
|
||||
pagebreak(weak: true)
|
||||
outline(
|
||||
title: heading(level: 3, title),
|
||||
indent: auto)
|
||||
}
|
||||
|
||||
#let new_outline() = {
|
||||
show outline.entry.where(
|
||||
level: 1,
|
||||
): it => {
|
||||
v(18pt, weak: true)
|
||||
strong(it)
|
||||
}
|
||||
|
||||
render_figures_outline()
|
||||
|
||||
render_table_outline()
|
||||
|
||||
render_raw_outline()
|
||||
|
||||
render_heading_outline()
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#let new_prerelease_note(thesis, author) = context [
|
||||
|
||||
#v(2em)
|
||||
#if text.lang == "de" [
|
||||
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Vorabfassung")
|
||||
] else if text.lang == "en" [
|
||||
|
|
|
@ -28,23 +28,14 @@
|
|||
#v(1cm)
|
||||
#text(size: 1.5em, weight: "bold", thesis.kind)
|
||||
|
||||
// number of semester
|
||||
#if text.lang == "de" [
|
||||
Praxisphase des #author.semester Studienjahrs
|
||||
] else if text.lang == "en" [
|
||||
Practical phase of the #author.semester academic year
|
||||
] else [
|
||||
#context panic("no translation for language: ", text.lang)
|
||||
]
|
||||
|
||||
// faculty
|
||||
#pad(top: 0.5cm)[
|
||||
#if text.lang == "de" [
|
||||
an der Fakultät für #author.faculty
|
||||
Praxisphase des #author.semester Studienjahrs an der Fakultät für #author.faculty
|
||||
#linebreak()
|
||||
im Studiengang #author.program
|
||||
] else if text.lang == "en" [
|
||||
at the Faculty of #author.faculty
|
||||
Practical phase of the #author.semester academic year at the Faculty of #author.faculty
|
||||
#linebreak()
|
||||
in the degree program #author.program
|
||||
] else [
|
||||
|
|
|
@ -33,14 +33,20 @@
|
|||
|
||||
#set raw(tab-size: 4)
|
||||
|
||||
#set block(spacing: 2em)
|
||||
#set par(
|
||||
justify: true,
|
||||
first-line-indent: 1em,
|
||||
leading: 1em)
|
||||
|
||||
#doc
|
||||
]
|
||||
|
||||
#let HeaderPaddingBottom = 3em
|
||||
#let HeaderPaddingBottom = 1.5em
|
||||
#let LogoHeight = 3em
|
||||
#let HeaderUnderlinePaddingTop = 8pt
|
||||
#let HeaderUnderlinePaddingTop = 0pt
|
||||
|
||||
#let prelude_styled(doc: content, thesis) = context [
|
||||
#let prelude_styled(body: content, thesis) = context [
|
||||
#set page(
|
||||
header-ascent: HeaderUnderlinePaddingTop + HeaderPaddingBottom,
|
||||
numbering: "I",
|
||||
|
@ -56,5 +62,40 @@
|
|||
#line(length: 100%)
|
||||
])
|
||||
|
||||
#doc
|
||||
#body
|
||||
]
|
||||
|
||||
#let content_styled(body: content, thesis) = [
|
||||
#set heading(numbering: "1.")
|
||||
#page(
|
||||
header-ascent: HeaderUnderlinePaddingTop + HeaderPaddingBottom,
|
||||
numbering: "1/1",
|
||||
footer-descent: 1em,
|
||||
margin: (top: 2.5cm + LogoHeight + HeaderUnderlinePaddingTop + HeaderPaddingBottom, bottom: 2.5cm + 1em),
|
||||
header: context [
|
||||
#let headers-before = query(selector(heading.where(numbering: "1.", level: 1)).before(here()))
|
||||
|
||||
#let header-title = thesis.title
|
||||
|
||||
#if headers-before.len() > 0 {
|
||||
header-title = headers-before.last().body
|
||||
} else {
|
||||
let headers-after = query(selector(heading.where(numbering: "1.", level: 1)).after(here()))
|
||||
|
||||
if headers-after.len() > 0 {
|
||||
header-title = headers-after.first().body
|
||||
}
|
||||
}
|
||||
|
||||
#grid(
|
||||
columns: (1fr, auto),
|
||||
align: (horizon, bottom),
|
||||
context [ _ #header-title _ ],
|
||||
image("pages/res/DHBW.svg", height: LogoHeight)
|
||||
)
|
||||
#v(HeaderUnderlinePaddingTop - 1em)
|
||||
#line(length: 100%)
|
||||
])[
|
||||
#body
|
||||
]
|
||||
]
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// start of template pages and styles
|
||||
#let dhbw-template(doc) = [
|
||||
|
||||
#import "style.typ": global_styled_doc, prelude_styled
|
||||
#import "style.typ": global_styled_doc, prelude_styled, content_styled
|
||||
|
||||
// apply global style to every element in the argument content
|
||||
#global_styled_doc(doc: [
|
||||
|
@ -19,6 +19,8 @@
|
|||
#import "pages/declaration-of-authorship.typ": new_declaration_of_authorship
|
||||
#import "pages/confidentiality-statement.typ": new_confidentiality_statement_page
|
||||
#import "pages/prerelease-note.typ": new_prerelease_note
|
||||
#import "pages/outline.typ": new_outline
|
||||
#import "pages/abstract.typ": new_abstract
|
||||
|
||||
#set text(lang: "de", region: "de")
|
||||
|
||||
|
@ -39,21 +41,36 @@
|
|||
subtitle: "für die AC500 SPS",
|
||||
submission-date: "20. März 2024",
|
||||
timeframe: "1. Januar 2023 - 20. März 2024",
|
||||
kind: "T2000"
|
||||
kind: "T2000",
|
||||
summary: "",
|
||||
abstract: "",
|
||||
)
|
||||
|
||||
// preppend title page
|
||||
#new_title_page(thesis, author)
|
||||
|
||||
#prelude_styled(thesis, doc: [
|
||||
#prelude_styled(thesis, body: [
|
||||
#pagebreak(weak: true)
|
||||
#new_declaration_of_authorship(thesis, author)
|
||||
#pagebreak()
|
||||
|
||||
#pagebreak(weak: true)
|
||||
#new_confidentiality_statement_page(thesis, author)
|
||||
#pagebreak()
|
||||
|
||||
#pagebreak(weak: true)
|
||||
#new_prerelease_note(thesis, author)
|
||||
|
||||
#pagebreak(weak: true)
|
||||
#new_outline()
|
||||
|
||||
#pagebreak(weak: true)
|
||||
#new_abstract(thesis)
|
||||
])
|
||||
|
||||
#content_styled(thesis, body: [
|
||||
// code of document follows here
|
||||
#doc
|
||||
])
|
||||
|
||||
|
||||
])
|
||||
]
|
Loading…
Reference in New Issue