fix: typst-0.13 (#121)
Reviewed-on: #121 Co-authored-by: servostar <sven.vogel123@web.de> Co-committed-by: servostar <sven.vogel123@web.de>
This commit is contained in:
parent
b1255bdbab
commit
ba9f81eccb
10
src/conf.typ
10
src/conf.typ
|
@ -104,7 +104,15 @@
|
|||
} else if val == none or type(val) == type(update_val) {
|
||||
base.insert(key, update_val)
|
||||
} else {
|
||||
panic("missmatched dictionary entry `" + key + "` type: expected `" + type(val) + "` got `" + type(update_val) + "`")
|
||||
panic(
|
||||
"missmatched dictionary entry `"
|
||||
+ key
|
||||
+ "` type: expected `"
|
||||
+ type(val)
|
||||
+ "` got `"
|
||||
+ type(update_val)
|
||||
+ "`",
|
||||
)
|
||||
}
|
||||
} else {
|
||||
base.insert(key, val)
|
||||
|
|
|
@ -59,8 +59,13 @@ SOFTWARE.*/
|
|||
let textLink = if display != none {
|
||||
[#display]
|
||||
} else if (
|
||||
(
|
||||
is_first or long == true
|
||||
) and entlong != [] and entlong != "" and long != false {
|
||||
)
|
||||
and entlong != []
|
||||
and entlong != ""
|
||||
and long != false
|
||||
) {
|
||||
[#entlong (#entry.short#suffix)]
|
||||
} else {
|
||||
[#entry.short#suffix]
|
||||
|
@ -108,8 +113,13 @@ SOFTWARE.*/
|
|||
}
|
||||
|
||||
let textLink = if (
|
||||
(
|
||||
is_first or long == true
|
||||
) and entlong != [] and entlong != "" and long != false {
|
||||
)
|
||||
and entlong != []
|
||||
and entlong != ""
|
||||
and long != false
|
||||
) {
|
||||
[#entlong (#short)]
|
||||
} else {
|
||||
[#short]
|
||||
|
@ -128,9 +138,11 @@ SOFTWARE.*/
|
|||
// show rule to make the references for glossarium
|
||||
#let make-glossary(body) = {
|
||||
show ref: r => {
|
||||
if r.element != none and r.element.func() == figure and r
|
||||
.element
|
||||
.kind == __glossarium_figure {
|
||||
if (
|
||||
r.element != none
|
||||
and r.element.func() == figure
|
||||
and r.element.kind == __glossarium_figure
|
||||
) {
|
||||
// call to the general citing function
|
||||
gls(str(r.target), suffix: r.citation.supplement)
|
||||
} else {
|
||||
|
@ -197,6 +209,7 @@ SOFTWARE.*/
|
|||
#let hasLong = long != "" and long != []
|
||||
#let hasDesc = desc != "" and desc != []
|
||||
|
||||
#set align(left)
|
||||
#block(
|
||||
below: 1.5em,
|
||||
width: 100%,
|
||||
|
@ -237,8 +250,7 @@ SOFTWARE.*/
|
|||
page-numbering,
|
||||
..counter(page).at(x),
|
||||
)]
|
||||
}
|
||||
)
|
||||
})
|
||||
.join(", ")
|
||||
}
|
||||
],
|
||||
|
|
|
@ -43,14 +43,18 @@
|
|||
if "desc" in v {
|
||||
assert(
|
||||
type(v.desc) == str,
|
||||
message: "The description of glossary entry `" + k + "` is not a string",
|
||||
message: "The description of glossary entry `"
|
||||
+ k
|
||||
+ "` is not a string",
|
||||
)
|
||||
}
|
||||
|
||||
if "group" in v {
|
||||
assert(
|
||||
type(v.group) == str,
|
||||
message: "The optional group of glossary entry `" + k + "` is not a string",
|
||||
message: "The optional group of glossary entry `"
|
||||
+ k
|
||||
+ "` is not a string",
|
||||
)
|
||||
} else {
|
||||
let acronym_group = if config.lang == "de" {
|
||||
|
@ -89,7 +93,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
return processed_glossary.pairs().map(((key, entry)) => (
|
||||
return processed_glossary
|
||||
.pairs()
|
||||
.map(((key, entry)) => (
|
||||
key: key,
|
||||
short: entry.short,
|
||||
long: eval(entry.at("long", default: ""), mode: "markup"),
|
||||
|
|
|
@ -126,7 +126,9 @@
|
|||
config,
|
||||
context [
|
||||
// add bibliography if set
|
||||
#if "bibliography" in config.thesis and config.thesis.bibliography != none {
|
||||
#if (
|
||||
"bibliography" in config.thesis and config.thesis.bibliography != none
|
||||
) {
|
||||
pagebreak(weak: true)
|
||||
counter(page).update(1)
|
||||
set bibliography(
|
||||
|
|
|
@ -56,7 +56,18 @@
|
|||
row-gutter: 0.75em,
|
||||
align(left, { line(length: 6cm) }),
|
||||
align(left, { line(length: 6cm) }),
|
||||
align(left, 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) }))
|
||||
align(
|
||||
left,
|
||||
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) },
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
|
@ -58,7 +58,18 @@
|
|||
row-gutter: 0.75em,
|
||||
align(left, { line(length: 6cm) }),
|
||||
align(left, { line(length: 6cm) }),
|
||||
align(left, 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) }))
|
||||
align(
|
||||
left,
|
||||
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) },
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
|
@ -18,9 +18,12 @@
|
|||
show outline.entry: it => {
|
||||
link(it.element.location())[
|
||||
#v(12pt, weak: true)
|
||||
#text(weight: "regular", it.body)
|
||||
#it.prefix()
|
||||
#[:]
|
||||
#h(0.5em)
|
||||
#text(weight: "regular", it.body())
|
||||
#box(width: 1fr, it.fill)
|
||||
#[ #it.page]
|
||||
#[ #it.page()]
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -21,14 +21,27 @@
|
|||
if config.style.header.logo-image == none {
|
||||
// error
|
||||
} else if config.style.header.logo-image.len() > 0 {
|
||||
align(left, image(config.style.header.logo-image, height: config.style.header.logo-height))
|
||||
align(
|
||||
left,
|
||||
image(
|
||||
config.style.header.logo-image,
|
||||
height: config.style.header.logo-height,
|
||||
),
|
||||
)
|
||||
} else {
|
||||
align(left, image("../res/DHBW.svg", height: config.style.header.logo-height))
|
||||
align(
|
||||
left,
|
||||
image("../res/DHBW.svg", height: config.style.header.logo-height),
|
||||
)
|
||||
},
|
||||
// right align logo of DHBW
|
||||
if config.style.header.logo-image.len() > 0 {
|
||||
align(right, image("../res/DHBW.svg", height: config.style.header.logo-height))
|
||||
})
|
||||
align(
|
||||
right,
|
||||
image("../res/DHBW.svg", height: config.style.header.logo-height),
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
#set align(center)
|
||||
|
||||
|
@ -138,15 +151,18 @@
|
|||
// set width of columns
|
||||
// we need two, so make both half the page width
|
||||
columns: (60%, 40%),
|
||||
align(left, if text.lang == "de" [
|
||||
align(
|
||||
left,
|
||||
if text.lang == "de" [
|
||||
Unterschrift des betrieblichen Betreuers
|
||||
] else if text.lang == "en" [
|
||||
Signature of the company supervisor
|
||||
] else [
|
||||
#context panic("no translation for language: ", text.lang)
|
||||
]
|
||||
],
|
||||
),
|
||||
align(right, { line(length: 6cm) })
|
||||
),
|
||||
align(right, {line(length: 6cm)})),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -193,13 +193,15 @@
|
|||
|
||||
// change the display supplement according to the text langugae
|
||||
// based on: https://github.com/typst/typst/issues/3273
|
||||
show figure.where(kind: raw): set figure(supplement: context {
|
||||
show figure.where(kind: raw): set figure(
|
||||
supplement: context {
|
||||
if text.lang == "de" {
|
||||
"Quelltext"
|
||||
} else {
|
||||
"Listing"
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
// APA style table
|
||||
set table(
|
||||
|
@ -245,9 +247,9 @@
|
|||
header-ascent: style.header.content-padding,
|
||||
footer-descent: style.header.content-padding,
|
||||
margin: (
|
||||
top: style.page.margin.top + style.header.underline-top-padding + style
|
||||
.header
|
||||
.content-padding,
|
||||
top: style.page.margin.top
|
||||
+ style.header.underline-top-padding
|
||||
+ style.header.content-padding,
|
||||
bottom: style.page.margin.bottom + style.footer.content-padding,
|
||||
left: style.page.margin.left,
|
||||
right: style.page.margin.right,
|
||||
|
@ -256,15 +258,13 @@
|
|||
let current-page = here().page()
|
||||
if current-page == 1 {
|
||||
[]
|
||||
} else if query(<end-of-prelude>)
|
||||
.first()
|
||||
.location()
|
||||
.page() > current-page {
|
||||
} else if (
|
||||
query(<end-of-prelude>).first().location().page() > current-page
|
||||
) {
|
||||
numbering("I", nums.pos().first())
|
||||
} else if query(<end-of-content>)
|
||||
.first()
|
||||
.location()
|
||||
.page() >= current-page {
|
||||
} else if (
|
||||
query(<end-of-content>).first().location().page() >= current-page
|
||||
) {
|
||||
numbering("1", nums.pos().first())
|
||||
} else {
|
||||
numbering("a", nums.pos().first())
|
||||
|
@ -277,10 +277,14 @@
|
|||
|
||||
#if page-number == 1 {
|
||||
[]
|
||||
} else if query(<end-of-prelude>).first().location().page() > page-number {
|
||||
} else if (
|
||||
query(<end-of-prelude>).first().location().page() > page-number
|
||||
) {
|
||||
set align(center)
|
||||
numbering("I", page-counter)
|
||||
} else if query(<end-of-content>).first().location().page() >= page-number {
|
||||
} else if (
|
||||
query(<end-of-content>).first().location().page() >= page-number
|
||||
) {
|
||||
numbering(
|
||||
"1 / 1",
|
||||
page-counter,
|
||||
|
@ -296,13 +300,11 @@
|
|||
|
||||
if current-page == 1 {
|
||||
// logo moved to content
|
||||
} else if query(<end-of-content>)
|
||||
.first()
|
||||
.location()
|
||||
.page() >= current-page and query(<end-of-prelude>)
|
||||
.first()
|
||||
.location()
|
||||
.page() < current-page + 1 {
|
||||
} else if (
|
||||
query(<end-of-content>).first().location().page() >= current-page
|
||||
and query(<end-of-prelude>).first().location().page()
|
||||
< current-page + 1
|
||||
) {
|
||||
let heading = currentH()
|
||||
|
||||
heading.at(0)
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
)
|
||||
))
|
||||
|
||||
#import "@preview/wrap-it:0.1.0": wrap-content
|
||||
#import "@preview/wrap-it:0.1.1": wrap-content
|
||||
|
||||
= Lorem Ipsum
|
||||
|
||||
|
|
Loading…
Reference in New Issue