fixed: outline including appendices

This commit is contained in:
Sven Vogel 2024-07-01 14:46:32 +02:00
parent ac70aade96
commit 968f63be78
7 changed files with 55 additions and 45 deletions

View File

@ -1,5 +1,6 @@
= Ein Text im Anhang = Ein Text im Anhang
#label("Anhang-A")
#lorem(50) #lorem(50)

View File

@ -1 +0,0 @@

View File

@ -29,15 +29,13 @@
key: "oidc", key: "oidc",
short: "OIDC", short: "OIDC",
long: "OpenID Connect", long: "OpenID Connect",
desc: [OpenID is an open standard and decentralized authentication protocol promoted by the non-profit #link("https://en.wikipedia.org/wiki/OpenID#OpenID_Foundation")[OpenID Foundation].], desc: [OpenID is an open standard and decentralized authentication protocol promoted by the non-profit #link("https://en.wikipedia.org/wiki/OpenID#OpenID_Foundation")[OpenID Foundation].]
group: "Akronyme",
), ),
( (
key: "potato", key: "potato",
short: "potato", short: "potato",
plural: "potatoes", plural: "potatoes",
desc: [#lorem(10)], desc: [#lorem(10)]
group: "Begriffe"
), ),
), ),
appendices: include "appendix.typ" appendices: include "appendix.typ"
@ -51,6 +49,7 @@
@oidc @oidc
#lorem(100) #lorem(100)
@Anhang-A
== Lorem Ipsum 2 == Lorem Ipsum 2

View File

@ -8,6 +8,12 @@
"Anhang" "Anhang"
} }
if "appendices" in config.thesis {
pagebreak(weak: true)
heading(level: 1, numbering: none, title)
v(-2em)
// APA style appendix // APA style appendix
show heading: it => { show heading: it => {
let number = if it.numbering != none { let number = if it.numbering != none {
@ -22,10 +28,7 @@
show heading.where(level: 2): it => v(1em) + it + v(0.5em) show heading.where(level: 2): it => v(1em) + it + v(0.5em)
show heading.where(level: 3): it => v(0.5em) + it + v(0.25em) show heading.where(level: 3): it => v(0.5em) + it + v(0.25em)
set heading(numbering: "A.1", supplement: [appendix]) set heading(numbering: "A.1", supplement: title)
if "appendices" in config.thesis {
pagebreak(weak: true)
config.thesis.appendices config.thesis.appendices
} }

View File

@ -55,12 +55,19 @@
pagebreak(weak: true) pagebreak(weak: true)
outline( outline(
target: heading.where(supplement: [chapter]),
title: heading(level: 3, title), title: heading(level: 3, title),
indent: auto) indent: auto)
} }
#let render_appendix_outline() = context { #let render_appendix_outline() = context {
if query(heading.where(supplement: [appendix])).len() > 0 { let supplement = if text.lang == "en" {
[Appendix]
} else {
[Anhang]
}
if query(heading.where(supplement: supplement)).len() > 0 {
let title = if (text.lang == "de") { let title = if (text.lang == "de") {
"Anhangsverzeichnis" "Anhangsverzeichnis"
} else if text.lang == "en" { } else if text.lang == "en" {
@ -69,7 +76,7 @@
pagebreak(weak: true) pagebreak(weak: true)
outline( outline(
target: heading.where(supplement: [appendix]), target: heading.where(supplement: supplement),
title: heading(level: 3, title), title: heading(level: 3, title),
indent: auto) indent: auto)
} }

View File

@ -32,6 +32,8 @@
font: "Montserrat", font: "Montserrat",
weight: "semibold") weight: "semibold")
#set heading(supplement: [chapter])
// Set header spacing // Set header spacing
#show heading.where(level: 1): it => v(2em) + it + v(1em) #show heading.where(level: 1): it => v(2em) + it + v(1em)
#show heading.where(level: 2): it => v(1em) + it + v(0.5em) #show heading.where(level: 2): it => v(1em) + it + v(0.5em)
@ -54,6 +56,7 @@
leading: 1em) leading: 1em)
#show link: set text(fill: red.darken(15%)) #show link: set text(fill: red.darken(15%))
#show ref: set text(fill: red.darken(15%))
#set heading(numbering: none) #set heading(numbering: none)
#set page( #set page(
@ -123,11 +126,6 @@
#body #body
] ]
#let prelude_styled(config: dictionary, body: content) = context [
#body
]
#let content_styled(config: dictionary, body: content) = [ #let content_styled(config: dictionary, body: content) = [
// setup equate for sub equation labeling // setup equate for sub equation labeling
#import "@preview/equate:0.2.0": equate #import "@preview/equate:0.2.0": equate

View File

@ -10,7 +10,7 @@
// start of template pages and styles // start of template pages and styles
#let dhbw-template(config: dictionary, doc: content) = [ #let dhbw-template(config: dictionary, doc: content) = [
#import "style.typ": global_styled_doc, prelude_styled, content_styled, end_styled #import "style.typ": global_styled_doc, content_styled, end_styled
// set document properties // set document properties
#set document( #set document(
@ -37,7 +37,7 @@
// prelude includes: title, declaration of authorship, confidentiality statement, outline and abstract // prelude includes: title, declaration of authorship, confidentiality statement, outline and abstract
// these will have roman page numbers // these will have roman page numbers
#prelude_styled(config: config, body: [
#pagebreak(weak: true) #pagebreak(weak: true)
#new_declaration_of_authorship(config) #new_declaration_of_authorship(config)
@ -50,17 +50,20 @@
#pagebreak(weak: true) #pagebreak(weak: true)
#new_outline() #new_outline()
#pagebreak(weak: true)
#new_abstract(config)
])
// glossary is built inline here because the links must be // glossary is built inline here because the links must be
// exposed to the entire document // exposed to the entire document
#import "@preview/glossarium:0.4.1": make-glossary, print-glossary, gls, glspl #import "@preview/glossarium:0.4.1": make-glossary, print-glossary, gls, glspl
#show: make-glossary #show: make-glossary
#pagebreak(weak: true) #pagebreak(weak: true)
#heading(supplement: [outline], "Glossar")
#print-glossary(config.thesis.glossary) #print-glossary(config.thesis.glossary)
#pagebreak(weak: true)
#new_abstract(config)
#pagebreak(weak: true) #pagebreak(weak: true)
#counter(page).update(1) #counter(page).update(1)