refined appendix

This commit is contained in:
Sven Vogel 2024-04-08 10:03:51 +02:00
parent 4e01b2f85c
commit ad004376c7
6 changed files with 72 additions and 27 deletions

View File

@ -18,7 +18,7 @@
#import "../prelude.typ" as prelude #import "../prelude.typ" as prelude
#set heading(numbering: none) #set heading(numbering: none, supplement: [Heading])
#set page(numbering: "I.", footer: "") #set page(numbering: "I.", footer: "")
#include "../pages/title.typ" #include "../pages/title.typ"

View File

@ -28,54 +28,69 @@
footer: "" footer: ""
) )
#let heading_outline_title = if prelude.format.language == "de" [ #set heading(supplement: [Heading])
Inhaltsverzeichnis #set page(numbering: "I.", footer: "")
#if prelude.format.language == "de" [
= Inhaltsverzeichnis
] else if prelude.format.language == "en" [ ] else if prelude.format.language == "en" [
Table of contents = Table of contents
] else [ ] else [
#panic("no translation for language: ", prelude.format.language) #panic("no translation for language: ", prelude.format.language)
] ]
#outline(title: heading_outline_title, indent: auto)
#par(first-line-indent: 0pt)[
#show outline.entry.where(
level: 1
): it => {
strong(it)
}
#outline(title: none, indent: auto, target: heading.where(supplement: [Heading]))
]
#pagebreak() #pagebreak()
#let image_outline_title = if prelude.format.language == "de" [ #if prelude.format.language == "de" [
Abbildungsverzeichnis = Abbildungsverzeichnis
] else if prelude.format.language == "en" [ ] else if prelude.format.language == "en" [
List of figures = List of figures
] else [ ] else [
#panic("no translation for language: ", prelude.format.language) #panic("no translation for language: ", prelude.format.language)
] ]
#outline( #outline(
title: image_outline_title, title: none,
target: figure.where(kind: image), target: figure.where(kind: image),
) )
#pagebreak() #pagebreak()
#let table_outline_title = if prelude.format.language == "de" [ #if prelude.format.language == "de" [
Tabellensverzeichnis = Tabellensverzeichnis
] else if prelude.format.language == "en" [ ] else if prelude.format.language == "en" [
List of tables = List of tables
] else [ ] else [
#panic("no translation for language: ", prelude.format.language) #panic("no translation for language: ", prelude.format.language)
] ]
#outline( #outline(
title: table_outline_title, title: none,
target: figure.where(kind: table), target: figure.where(kind: table),
) )
#pagebreak() #pagebreak()
#let raw_outline_title = if prelude.format.language == "de" [ #if prelude.format.language == "de" [
Quelltextverzeichnis = Quelltextverzeichnis
] else if prelude.format.language == "en" [ ] else if prelude.format.language == "en" [
Table of source code = List of source code
] else [ ] else [
#panic("no translation for language: ", prelude.format.language) #panic("no translation for language: ", prelude.format.language)
] ]
#outline( #outline(
title: raw_outline_title, title: none,
target: figure.where(kind: raw), target: figure.where(kind: raw),
) )
@ -98,7 +113,7 @@
// destination array // destination array
#let glossary_entries = () #let glossary_entries = ()
// parse TOML entries into correct format // parse YAML entries into correct format
#if glossary.glossary != none { #if glossary.glossary != none {
for entry in glossary.glossary { for entry in glossary.glossary {
let short = entry.at("short", default: none) let short = entry.at("short", default: none)
@ -115,5 +130,20 @@
#print-glossary(glossary_entries) #print-glossary(glossary_entries)
#pagebreak()
#if prelude.format.language == "de" [
= Anhangsverzeichnis
] else if prelude.format.language == "en" [
= List of appendencies
] else [
#panic("no translation for language: ", prelude.format.language)
]
#outline(
title: none,
target: heading.where(supplement: [Appendix]),
)
// reset page counter // reset page counter
#counter(page).update(0) #counter(page).update(0)

View File

@ -12,6 +12,9 @@
#import "../prelude.typ" as prelude #import "../prelude.typ" as prelude
#set heading(supplement: [Heading])
#set page(numbering: "I.", footer: "")
#set page( #set page(
binding: left, binding: left,
header-ascent: 2em, header-ascent: 2em,

View File

@ -131,6 +131,8 @@
footer: "" footer: ""
) )
#set heading(supplement: [Heading])
#include "pages/introduction.typ" #include "pages/introduction.typ"
// ------------------------------------------ // ------------------------------------------

View File

@ -28,13 +28,28 @@
#set heading(numbering: none) #set heading(numbering: none)
#if prelude.format.language == "de" [
= Anhang
] else if prelude.format.language == "en" [
= Appendix = Appendix
] else [
#panic("no translation for language: ", prelude.format.language)
]
#set heading(numbering: "A.1") #set heading(numbering: "A.1")
// reset page counter // reset page counter
#counter(heading).update(1) #counter(heading).update(1)
#let appendix(text) = [
#heading(
supplement: [Appendix],
level: 2,
numbering: "A.1",
)[#text]
<#text>
]
// ------------------------------------------ // ------------------------------------------
// Put your appendencies here and link them // Put your appendencies here and link them
// to correclty reference them in the document // to correclty reference them in the document
@ -42,10 +57,9 @@
// Example: // Example:
// //
// == Appendix title // #appendix([Titel])
// <appendix-section-link-name>
// //
// Some appendix content goes here // Some appendix content goes here
// Then reference with in the document: // Then reference it in the document:
// @appendix-section-link-name // @Titel

View File

@ -2,7 +2,3 @@
#import "../prelude.typ" as prelude #import "../prelude.typ" as prelude
= Einleitung = Einleitung
#pagebreak()
= Test