#let thesis_meta(title, subtitle, author, degree, supervisor, submission_date) = (
  title: title,
  subtitle: subtitle,
  author: author,
  degree: degree,
  supervisor: supervisor,
  submission_date: submission_date,
)

#let cover(meta) = [
  #set page(numbering: none)
  #align(center)[
    #set text(font: "Times New Roman", size: 12pt)
    #v(5cm)

    #text(size: 20pt, weight: "bold")[#meta.title]
    #if meta.subtitle != none [
      #v(6mm)
      #text(size: 14pt)[#meta.subtitle]
    ]

    #v(2cm)
    #text(size: 12pt)[Masterarbeit]
    #v(4mm)
    #text(size: 12pt)[#meta.degree]

    #v(3cm)
    #text(size: 12pt)[Autor: #meta.author]
    #v(2mm)
    #text(size: 12pt)[Betreuer: #meta.supervisor]
    #v(2mm)
    #text(size: 12pt)[Abgabedatum: #meta.submission_date]

    #v(2cm)
    #text(size: 10pt)[University of Applied Sciences Neu-Ulm]
  ]
]

#let declaration(meta) = [
  #set page(numbering: none)
  #set text(font: "Times New Roman", size: 11pt)
  #set par(leading: 14pt)
  #heading(level: 1)[Eigenständigkeitserklärung]

  Hiermit versichere ich, die vorliegende Masterarbeit selbstständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel verwendet zu haben. Alle wörtlich oder sinngemäß übernommenen Textstellen sind als solche gekennzeichnet.

  #v(2cm)
  #align(left)[
    #text(size: 11pt)[Neu-Ulm, #raw("______________________________")]
    #v(3mm)
    #text(size: 11pt)[Unterschrift: #raw("______________________________")]
  ]
]

#let abstract(content) = [
  #set page(numbering: "1")
  #set text(font: "Times New Roman", size: 11pt)
  #set par(justify: true, leading: 14pt)
  #content
]

#let body_show() = []

#let body_content(children) = [
  #set page(
    paper: "a4",
    margin: (top: 25mm, bottom: 25mm, inside: 30mm, outside: 20mm),
    numbering: "1",
  )
  #set text(font: "Times New Roman", size: 11pt)
  #set par(justify: true)
  #set list(indent: 6mm, spacing: 2mm)
  #set enum(numbering: "a)")
  #set heading(numbering: "1.1.1", depth: 3)
  #show heading.where(level: 1): it => [
    #set text(size: 16pt, weight: "bold")
    #it
  ]
  #show heading.where(level: 2): it => [
    #set text(size: 13pt, weight: "semibold")
    #it
  ]
  #show heading.where(level: 3): it => [
    #set text(size: 12pt, weight: "semibold")
    #it
  ]
  #set terms(separator: [], hanging-indent: 0pt, tight: false)
  #show terms.item: it => block(below: 0.8em, [
    #strong(it.term) \
    #it.description
  ])
  #show terms: it => {
    it
    v(2cm)
  }
  // Markdown-like styling for fenced code blocks.
  #show raw: set text(font: "DejaVu Sans Mono", size: 9.5pt, fill: luma(20))
  #show raw.where(block: true): it => block(
    width: 100%,
    fill: luma(240),
    stroke: 0.5pt + luma(190),
    inset: 9pt,
    radius: 4pt,
    above: 0.8em,
    below: 0.8em,
    it,
  )
  #children
]

#let thesis = (
  meta: thesis_meta,
  cover: cover,
  declaration: declaration,
  abstract: abstract,
  body_show: body_show,
  body_content: body_content,
)
