Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: fhac:0.1.0 #538

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/preview/fhac/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Andrei Alexeev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Empty file.
Binary file added packages/preview/fhac/0.1.0/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
178 changes: 178 additions & 0 deletions packages/preview/fhac/0.1.0/template.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// Workaround for the lack of an `std` scope.
#let std-bibliography = bibliography

#let size = (
xsm: 6pt,
sm: 12pt,
md: 16pt,
lg: 24pt,
xl: 32pt,
xxl: 48pt
)

#let i18n = (
de: (
submittedBy: "Eingereicht von",
studentId: "Matrikelnummer",
date: "Datum",
examiner: "Prüfer",
toObtainDegree: "Zur Erlangung des akademischen Grades",
disclaimerLabel: "Erklärung",
disclaimerText: "Hiermit versichere ich, dass ich die vorliegende Arbeit selbstständig verfasst und keine anderen als die im Literaturverzeichnis angegebenen Quellen benutzt habe. Stellen, die wörtlich oder sinngemäß aus veröffentlichten oder noch nicht veröffentlichten Quellen entnommen sind, sind als solche kenntlich gemacht. Die Zeichnungen oder Abbildungen in dieser Arbeit sind von mir selbst erstellt worden oder mit einem entsprechenden Nachweis versehen. Diese Arbeit ist in gleicher oder ähnlicher Form noch bei keiner anderen Prüfungsbehörde eingereicht worden."
),
en: (
submittedBy: "Submitted by",
studentId: "Matriculation number",
date: "Date",
examiner: "Examiner",
toObtainDegree: "To obtain the academic degree",
disclaimerLabel: "I confirm that this is my own work and I have documented all sources and material used. ",
disclaimerText: "I confirm that this is my own work and I have documented all sources and material used."
),
)

#let getLanguage(lang: "en", key: "") = {
if(lang in i18n){
if(key in i18n.at(lang)){
return [#i18n.at(lang).at(key)]
}else{
return [#key]
}
}else{
return [#key]
}
}

#let signatureBox(body) = {
[
#line(length: 100%)
#align(center)[#body]
]
}

#let CoverPage(title, faculty, field, degree, submittedBy, date, examiner, t) = {
align(center, [
#{
place(top + right, dx: 96pt, dy: -32pt)[#image("img/logo.png", height: 128pt)]
v(96pt)
text(size: size.lg)[FH Aachen]
v(size.xsm)
text(size: size.md)[#faculty]
v(50pt)
text(size: size.xl)[Master Thesis]
v(size.xsm)
[#t(key: "toObtainDegree") \ #field ]
v(size.xxl)
text(size.md, weight: "semibold")[#title]
v(size.xxl)
v(size.xxl)

let grid2x2 = grid.with(
columns: 2,
column-gutter: size.sm,
align: start,
row-gutter: size.xsm
)

grid2x2(
[#t(key: "submittedBy"):], [#submittedBy.name],
[#t(key: "studentId"):], [ #submittedBy.id]
)

v(size.xl)
grid2x2([#t(key: "date"):], [#date])
v(size.xl)

grid2x2(..examiner.map(val => ([#t(key: "examiner"):], [#val])).flatten())
}
])
}

#let template(
title: [Title],
faculty: [Faculty],
field: [Field of study],
degree: [Bachelor's Thesis or Master's Thesis],
submittedBy: (),
date: none,
examiner: (),
paper-size: "a4",
language: "en",
bibliography: none,
body
) = {
let t = getLanguage.with(lang: language)
set document(title: title, author: submittedBy.name)
set text(font: "STIX Two Text", size: 12pt)

[#CoverPage(title, faculty, field, degree, submittedBy, date, examiner, t)]

// Configure equation numbering and spacing.
set math.equation(numbering: "(1)")
show math.equation: set block(spacing: 0.65em)

// Configure appearance of equation references
show ref: it => {
if it.element != none and it.element.func() == math.equation {
// Override equation references.
link(it.element.location(), numbering(
it.element.numbering,
..counter(math.equation).at(it.element.location())
))
} else {
// Other references as usual.
it
}
}

// Configure lists.
set enum(indent: 10pt, body-indent: 9pt)
set list(indent: 10pt, body-indent: 9pt)

// Configure headings.
set heading(numbering: "1.1.1")

set page(
paper: paper-size,
numbering:none,
number-align: right,
binding:left,
)
show outline.entry.where(level: 1): it => {
v(12pt, weak: true)
strong(it)
}





pagebreak()
pagebreak()

outline(indent: auto)

pagebreak()
place(bottom, dy: -40pt)[
#heading(numbering: none, level: 1, [#t(key: "disclaimerLabel")])
#t(key: "disclaimerText")
#v(10%)
#grid(
columns: (1fr, 1fr),
rows: 1,
gutter: 30%,
[#signatureBox()[#date]],
[#signatureBox()[#submittedBy.name]]
)
]


pagebreak()



counter(page).update(1)

body

}
15 changes: 15 additions & 0 deletions packages/preview/fhac/0.1.0/template/glossary.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#let glossary = (
// minimal term
(key: "kuleuven", short: "KU Leuven"),
// a term with a long form
(key: "unamur", short: "UNamur", long: "Université de Namur"),
// no long form here
(key: "kdecom", short: "KDE Community", desc:"An international team developing and distributing Open Source software."),
// a full term with description containing markup
(
key: "oidc",
short: "OIDC",
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].]),
)
1 change: 1 addition & 0 deletions packages/preview/fhac/0.1.0/template/img/dummy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions packages/preview/fhac/0.1.0/template/lit.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@STRING{hh = {Hans Hagen}}

@ARTICLE{hh2010a,
author = hh,
title = {The Font Name Mess},
journal = {MAPS},
year = {2010},
volume = {40},
pages = {2-8},
keywords = {context},
}

@ARTICLE{hh2010b,
author = hh,
title = {Grouping in Hybrid Environments},
journal = {MAPS},
year = {2010},
volume = {40},
pages = {67-71},
keywords = {context},
}

@BOOK{Eijkhout1991,
title = {\TeX\ by Topic. A \TeX nician's Reference},
publisher = {Addison-Wesley},
year = {1991},
author = {Victor Eijkhout},
address = {London},
keywords = {general},
}
Loading
Loading