Compare commits

..

No commits in common. "21b29fcf4ce780508586c80c9522c9dec3f16c80" and "b1255bdbabd653a5edd55f08396d126bb68854be" have entirely different histories.

11 changed files with 107 additions and 178 deletions

View File

@ -24,7 +24,7 @@ jobs:
nix-shell --run ./run-ci.sh nix-shell --run ./run-ci.sh
- name: Upload artifact - name: Upload artifact
id: artifact-upload id: artifact-upload
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: example-document name: example-document
path: ${{ github.workspace }}/example.pdf path: ${{ github.workspace }}/example.pdf

View File

@ -104,15 +104,7 @@
} else if val == none or type(val) == type(update_val) { } else if val == none or type(val) == type(update_val) {
base.insert(key, update_val) base.insert(key, update_val)
} else { } else {
panic( panic("missmatched dictionary entry `" + key + "` type: expected `" + type(val) + "` got `" + type(update_val) + "`")
"missmatched dictionary entry `"
+ key
+ "` type: expected `"
+ type(val)
+ "` got `"
+ type(update_val)
+ "`",
)
} }
} else { } else {
base.insert(key, val) base.insert(key, val)

View File

@ -59,13 +59,8 @@ SOFTWARE.*/
let textLink = if display != none { let textLink = if display != none {
[#display] [#display]
} else if ( } else if (
( is_first or long == true
is_first or long == true ) and entlong != [] and entlong != "" and long != false {
)
and entlong != []
and entlong != ""
and long != false
) {
[#entlong (#entry.short#suffix)] [#entlong (#entry.short#suffix)]
} else { } else {
[#entry.short#suffix] [#entry.short#suffix]
@ -113,13 +108,8 @@ SOFTWARE.*/
} }
let textLink = if ( let textLink = if (
( is_first or long == true
is_first or long == true ) and entlong != [] and entlong != "" and long != false {
)
and entlong != []
and entlong != ""
and long != false
) {
[#entlong (#short)] [#entlong (#short)]
} else { } else {
[#short] [#short]
@ -138,11 +128,9 @@ SOFTWARE.*/
// show rule to make the references for glossarium // show rule to make the references for glossarium
#let make-glossary(body) = { #let make-glossary(body) = {
show ref: r => { show ref: r => {
if ( if r.element != none and r.element.func() == figure and r
r.element != none .element
and r.element.func() == figure .kind == __glossarium_figure {
and r.element.kind == __glossarium_figure
) {
// call to the general citing function // call to the general citing function
gls(str(r.target), suffix: r.citation.supplement) gls(str(r.target), suffix: r.citation.supplement)
} else { } else {
@ -209,7 +197,6 @@ SOFTWARE.*/
#let hasLong = long != "" and long != [] #let hasLong = long != "" and long != []
#let hasDesc = desc != "" and desc != [] #let hasDesc = desc != "" and desc != []
#set align(left)
#block( #block(
below: 1.5em, below: 1.5em,
width: 100%, width: 100%,
@ -242,15 +229,16 @@ SOFTWARE.*/
) )
.values .values
.map(x => { .map(x => {
let page-numbering = x.page-numbering() let page-numbering = x.page-numbering()
if page-numbering == none { if page-numbering == none {
page-numbering = "1" page-numbering = "1"
}
link(x)[#numbering(
page-numbering,
..counter(page).at(x),
)]
} }
link(x)[#numbering( )
page-numbering,
..counter(page).at(x),
)]
})
.join(", ") .join(", ")
} }
], ],

View File

@ -43,18 +43,14 @@
if "desc" in v { if "desc" in v {
assert( assert(
type(v.desc) == str, type(v.desc) == str,
message: "The description of glossary entry `" message: "The description of glossary entry `" + k + "` is not a string",
+ k
+ "` is not a string",
) )
} }
if "group" in v { if "group" in v {
assert( assert(
type(v.group) == str, type(v.group) == str,
message: "The optional group of glossary entry `" message: "The optional group of glossary entry `" + k + "` is not a string",
+ k
+ "` is not a string",
) )
} else { } else {
let acronym_group = if config.lang == "de" { let acronym_group = if config.lang == "de" {
@ -93,13 +89,11 @@
} }
} }
return processed_glossary return processed_glossary.pairs().map(((key, entry)) => (
.pairs() key: key,
.map(((key, entry)) => ( short: entry.short,
key: key, long: eval(entry.at("long", default: ""), mode: "markup"),
short: entry.short, desc: eval(entry.at("desc", default: ""), mode: "markup"),
long: eval(entry.at("long", default: ""), mode: "markup"), group: entry.at("group", default: ""),
desc: eval(entry.at("desc", default: ""), mode: "markup"), ))
group: entry.at("group", default: ""),
))
} }

View File

@ -126,9 +126,7 @@
config, config,
context [ context [
// add bibliography if set // add bibliography if set
#if ( #if "bibliography" in config.thesis and config.thesis.bibliography != none {
"bibliography" in config.thesis and config.thesis.bibliography != none
) {
pagebreak(weak: true) pagebreak(weak: true)
counter(page).update(1) counter(page).update(1)
set bibliography( set bibliography(

View File

@ -50,24 +50,13 @@
set align(horizon) set align(horizon)
grid( grid(
// set width of columns // set width of columns
// we need two, so make both half the page width // we need two, so make both half the page width
columns: (50%, 50%), columns: (50%, 50%),
row-gutter: 0.75em, row-gutter: 0.75em,
align(left, { line(length: 6cm) }), align(left, {line(length: 6cm)}),
align(left, { line(length: 6cm) }), align(left, {line(length: 6cm)}),
align( align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }),
left, align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [
Place, Date
] else { panic("no translation for language: ", text.lang) },
),
align(
left,
if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [
Signature
] else { panic("no translation for language: ", text.lang) },
)
)
} }
) )

View File

@ -52,24 +52,13 @@
set align(horizon) set align(horizon)
grid( grid(
// set width of columns // set width of columns
// we need two, so make both half the page width // we need two, so make both half the page width
columns: (50%, 50%), columns: (50%, 50%),
row-gutter: 0.75em, row-gutter: 0.75em,
align(left, { line(length: 6cm) }), align(left, {line(length: 6cm)}),
align(left, { line(length: 6cm) }), align(left, {line(length: 6cm)}),
align( align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ Place, Date ] else { panic("no translation for language: ", text.lang) }),
left, align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [
Place, Date
] else { panic("no translation for language: ", text.lang) },
),
align(
left,
if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [
Signature
] else { panic("no translation for language: ", text.lang) },
)
)
} }
) )

View File

@ -18,12 +18,9 @@
show outline.entry: it => { show outline.entry: it => {
link(it.element.location())[ link(it.element.location())[
#v(12pt, weak: true) #v(12pt, weak: true)
#it.prefix() #text(weight: "regular", it.body)
#[:]
#h(0.5em)
#text(weight: "regular", it.body())
#box(width: 1fr, it.fill) #box(width: 1fr, it.fill)
#[ #it.page()] #[ #it.page]
] ]
} }

View File

@ -21,27 +21,14 @@
if config.style.header.logo-image == none { if config.style.header.logo-image == none {
// error // error
} else if config.style.header.logo-image.len() > 0 { } else if config.style.header.logo-image.len() > 0 {
align( align(left, image(config.style.header.logo-image, height: config.style.header.logo-height))
left,
image(
config.style.header.logo-image,
height: config.style.header.logo-height,
),
)
} else { } else {
align( align(left, image("../res/DHBW.svg", height: config.style.header.logo-height))
left,
image("../res/DHBW.svg", height: config.style.header.logo-height),
)
}, },
// right align logo of DHBW // right align logo of DHBW
if config.style.header.logo-image.len() > 0 { if config.style.header.logo-image.len() > 0 {
align( align(right, image("../res/DHBW.svg", height: config.style.header.logo-height))
right, })
image("../res/DHBW.svg", height: config.style.header.logo-height),
)
}
)
#set align(center) #set align(center)
@ -121,20 +108,20 @@
.authors .authors
.slice(i * 3, i * 3 + cols) .slice(i * 3, i * 3 + cols)
.map(author => par([ .map(author => par([
#if author.at("name", default: none) != none { #if author.at("name", default: none) != none {
text(size: 1.25em, author.name) text(size: 1.25em, author.name)
linebreak() linebreak()
} }
#if author.at("company", default: none) != none { #if author.at("company", default: none) != none {
text(size: 1em, author.company) text(size: 1em, author.company)
linebreak() linebreak()
} }
#if author.at("contact", default: none) != none { #if author.at("contact", default: none) != none {
text(size: 1em, author.contact) text(size: 1em, author.contact)
linebreak() linebreak()
} }
#str(author.matriculation-number), #author.course #str(author.matriculation-number), #author.course
]))) ])))
} }
] ]
@ -148,21 +135,18 @@
align( align(
bottom, bottom,
grid( grid(
// set width of columns // set width of columns
// we need two, so make both half the page width // we need two, so make both half the page width
columns: (60%, 40%), columns: (60%, 40%),
align( align(left, if text.lang == "de" [
left, Unterschrift des betrieblichen Betreuers
if text.lang == "de" [ ] else if text.lang == "en" [
Unterschrift des betrieblichen Betreuers Signature of the company supervisor
] else if text.lang == "en" [ ] else [
Signature of the company supervisor #context panic("no translation for language: ", text.lang)
] else [ ]
#context panic("no translation for language: ", text.lang)
],
),
align(right, { line(length: 6cm) })
), ),
align(right, {line(length: 6cm)})),
) )
} }

View File

@ -166,10 +166,10 @@
.map(make_row) .map(make_row)
.flatten() .flatten()
.map(c => if c.has("text") and c.text == "" { .map(c => if c.has("text") and c.text == "" {
v(1em) v(1em)
} else { } else {
c c
}) })
) )
}, },
) )
@ -193,15 +193,13 @@
// change the display supplement according to the text langugae // change the display supplement according to the text langugae
// based on: https://github.com/typst/typst/issues/3273 // based on: https://github.com/typst/typst/issues/3273
show figure.where(kind: raw): set figure( show figure.where(kind: raw): set figure(supplement: context {
supplement: context { if text.lang == "de" {
if text.lang == "de" { "Quelltext"
"Quelltext" } else {
} else { "Listing"
"Listing" }
} })
},
)
// APA style table // APA style table
set table( set table(
@ -247,9 +245,9 @@
header-ascent: style.header.content-padding, header-ascent: style.header.content-padding,
footer-descent: style.header.content-padding, footer-descent: style.header.content-padding,
margin: ( margin: (
top: style.page.margin.top top: style.page.margin.top + style.header.underline-top-padding + style
+ style.header.underline-top-padding .header
+ style.header.content-padding, .content-padding,
bottom: style.page.margin.bottom + style.footer.content-padding, bottom: style.page.margin.bottom + style.footer.content-padding,
left: style.page.margin.left, left: style.page.margin.left,
right: style.page.margin.right, right: style.page.margin.right,
@ -258,13 +256,15 @@
let current-page = here().page() let current-page = here().page()
if current-page == 1 { if current-page == 1 {
[] []
} else if ( } else if query(<end-of-prelude>)
query(<end-of-prelude>).first().location().page() > current-page .first()
) { .location()
.page() > current-page {
numbering("I", nums.pos().first()) numbering("I", nums.pos().first())
} else if ( } else if query(<end-of-content>)
query(<end-of-content>).first().location().page() >= current-page .first()
) { .location()
.page() >= current-page {
numbering("1", nums.pos().first()) numbering("1", nums.pos().first())
} else { } else {
numbering("a", nums.pos().first()) numbering("a", nums.pos().first())
@ -277,14 +277,10 @@
#if page-number == 1 { #if page-number == 1 {
[] []
} else if ( } else if query(<end-of-prelude>).first().location().page() > page-number {
query(<end-of-prelude>).first().location().page() > page-number
) {
set align(center) set align(center)
numbering("I", page-counter) numbering("I", page-counter)
} else if ( } else if query(<end-of-content>).first().location().page() >= page-number {
query(<end-of-content>).first().location().page() >= page-number
) {
numbering( numbering(
"1 / 1", "1 / 1",
page-counter, page-counter,
@ -300,11 +296,13 @@
if current-page == 1 { if current-page == 1 {
// logo moved to content // logo moved to content
} else if ( } else if query(<end-of-content>)
query(<end-of-content>).first().location().page() >= current-page .first()
and query(<end-of-prelude>).first().location().page() .location()
< current-page + 1 .page() >= current-page and query(<end-of-prelude>)
) { .first()
.location()
.page() < current-page + 1 {
let heading = currentH() let heading = currentH()
heading.at(0) heading.at(0)

View File

@ -45,7 +45,7 @@
) )
)) ))
#import "@preview/wrap-it:0.1.1": wrap-content #import "@preview/wrap-it:0.1.0": wrap-content
= Lorem Ipsum = Lorem Ipsum