diff --git a/assets/thumbnail.png b/assets/thumbnail.png new file mode 100644 index 0000000..c1a4d53 Binary files /dev/null and b/assets/thumbnail.png differ diff --git a/examples/appendix.typ b/examples/appendix.typ deleted file mode 100644 index 370ade6..0000000 --- a/examples/appendix.typ +++ /dev/null @@ -1,9 +0,0 @@ - -= Ein Text im Anhang -#label("Anhang-A") - -#lorem(50) - -== Noch mehr Text im Anhang - -#lorem(50) diff --git a/examples/glossary.typ b/examples/glossary.typ deleted file mode 100644 index e69de29..0000000 diff --git a/examples/lipsum.typ b/examples/lipsum.typ deleted file mode 100644 index bc4de19..0000000 --- a/examples/lipsum.typ +++ /dev/null @@ -1,115 +0,0 @@ - -#import "../src/template.typ": dhbw-template - -#let config = ( - lang: "de", - region: "de", - author: ( - name: "Sven Vogel", - semester: 4, - program: "Informationstechnik", - course: "TINF22IT2", - faculty: "Technik", - university: "DHBW Mannheim", - company: "ABB AG", - supervisor: "Florian Miedniak", - matriculation-number: 1191225), - thesis: ( - title: "Konfiguration & Integration von PROFINET", - subtitle: "für die AC500 SPS", - submission-date: "20. März 2024", - timeframe: "1. Januar 2023 - 20. März 2024", - kind: "T2000", - summary: "", - abstract: "", - keywords: ( "IT", "PROFINET" ), - bibliography: bibliography("refs.yml"), - glossary: ( - ( - 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].] - ), - ( - key: "potato", - short: "potato", - plural: "potatoes", - desc: [#lorem(10)] - ), - ), - appendices: include "appendix.typ" -)) - -#show: doc => dhbw-template(config: config, doc: doc) - -= Lorem Ipsum - -#lorem(25) -@oidc - -#lorem(100) -@Anhang-A - -== Lorem Ipsum 2 - -#lorem(200) -@texbook - -= Lorem Ipsum 3 - -#lorem(15) - -$ - angle.l a, b angle.r &= arrow(a) dot arrow(b) \ - &= a_1 b_1 + a_2 b_2 + ... a_n b_n \ - &= sum_(i=1)^n a_i b_i. -$ - -#figure(image("digitaldog.jpg", height: 480pt), caption: [ Some image caption ]) - -#figure( - table( - columns: 2, - "Hello", "World"), - caption: [ Some table ]) - -#pagebreak() - -#figure( - ```rust -use std::env; -use std::fs::OpenOptions; -use std::io::Write; - -fn main() { - // Get the file path from the environment variable - let file_path = match env::var("OUTPUT_FILE") { - Ok(path) => path, - Err(_) => { - eprintln!("Error: OUTPUT_FILE environment variable is not set"); - return; - } - }; - - // Open the file in append mode, create it if it doesn't exist - let mut file = match OpenOptions::new() - .append(true) - .create(true) - .open(&file_path) - { - Ok(file) => file, - Err(e) => { - eprintln!("Error opening file {}: {}", file_path, e); - return; - } - }; - - // Write "Hello, World" to the file - if let Err(e) = writeln!(file, "Hello, World") { - eprintln!("Error writing to file: {}", e); - } else { - println!("Successfully appended 'Hello, World' to {}", file_path); - } -} - ```, caption: [Some code]) \ No newline at end of file diff --git a/examples/refs.yml b/examples/refs.yml deleted file mode 100644 index 11b1e86..0000000 --- a/examples/refs.yml +++ /dev/null @@ -1,6 +0,0 @@ -texbook: - type: book - title: The {TeX} Book - author: Knuth, Donald E. - date: 1986 - publisher: Addison-Wesley Professional diff --git a/src/conf.typ b/src/conf.typ index b303d44..728de8c 100644 --- a/src/conf.typ +++ b/src/conf.typ @@ -6,5 +6,3 @@ // Author: Sven Vogel // Edited: 27.06.2024 // License: MIT - - diff --git a/src/template.typ b/src/lib.typ similarity index 97% rename from src/template.typ rename to src/lib.typ index 5cab92b..da91091 100644 --- a/src/template.typ +++ b/src/lib.typ @@ -8,10 +8,12 @@ // License: MIT // start of template pages and styles -#let dhbw-template(config: dictionary, doc: content) = [ +#let dhbw-template(config: dictionary, body) = [ #import "style.typ": global_styled_doc, content_styled, end_styled + #let doc = body + // set document properties #set document( author: config.author.name, @@ -47,6 +49,9 @@ #pagebreak(weak: true) #new_prerelease_note(config) + #pagebreak(weak: true) + #new_abstract(config) + #pagebreak(weak: true) #new_outline() @@ -61,9 +66,6 @@ #print-glossary(config.thesis.glossary) - #pagebreak(weak: true) - #new_abstract(config) - #pagebreak(weak: true) #counter(page).update(1) diff --git a/src/pages/confidentiality-statement.typ b/src/pages/confidentiality-statement.typ index d4c2f11..4c508e3 100644 --- a/src/pages/confidentiality-statement.typ +++ b/src/pages/confidentiality-statement.typ @@ -33,7 +33,7 @@ #if text.lang == "de" [ darf weder als Ganzes noch in Auszügen Personen außerhalb des Prüfungsprozesses und des Evalua-tionsverfahrens zugänglich gemacht werden, sofern keine anderslautende Genehmigung der Ausbildungsstätte vorliegt. - ] else if text.lang = "en" [ + ] else if text.lang == "en" [ may not be made accessible to persons outside the examination process and the evaluation procedure, either as a whole or in excerpts, unless otherwise authorized by the training institution. ] diff --git a/src/pages/prerelease-note.typ b/src/pages/prerelease-note.typ index 6a3dfee..967b062 100644 --- a/src/pages/prerelease-note.typ +++ b/src/pages/prerelease-note.typ @@ -36,7 +36,7 @@ #if text.lang == "de" [ handelt es sich _nicht_ um die fertige Fassung. Das Dokument kann Inhaltliche-, Grammatikalische- sowie Format-Fehler enthalten. Das Dokument ist im Rahmen der Aufgabenstellung von Seiten der #author.university nicht zur Bewertung freigegeben und ein anderer Verwendungszweck als eine Vorschau ist nicht gestattet. ] else if text.lang == "en" [ - is _not_ the final version. The document may contain content, grammatical and format errors. The document is not released for evaluation by #author.university within the scope of the assignment and any use other than a preview is not permitted. + is not the final version. The document may contain errors in content, grammar and formatting. The document may not be released for evaluation to #author.university as part of the assignment, and any use other than a preview is not permitted. ] #v(1em) diff --git a/src/style.typ b/src/style.typ index 2583fe8..19258ac 100644 --- a/src/style.typ +++ b/src/style.typ @@ -127,11 +127,6 @@ ] #let content_styled(config: dictionary, body: content) = [ - // setup equate for sub equation labeling - #import "@preview/equate:0.2.0": equate - #show: equate.with(breakable: true, sub-numbering: true) - #set math.equation(numbering: "(1.1)") - #set heading(numbering: "1.") #let thesis = config.thesis diff --git a/template/abstract.typ b/template/abstract.typ new file mode 100644 index 0000000..46959c9 --- /dev/null +++ b/template/abstract.typ @@ -0,0 +1,12 @@ + +// English summary "abstract" is content of this block: +#let abstract = [ + #lorem(100) +] + +// Other languages abstract translation is content of this block: +// NOTE: An abstract is required in case the thesis is not written primarily in english +// if writing in english (and the language is set to "en") this can be let empty or set to none +#let summary = [ + #lorem(100) +] diff --git a/template/appendix.typ b/template/appendix.typ new file mode 100644 index 0000000..09e2c77 --- /dev/null +++ b/template/appendix.typ @@ -0,0 +1,9 @@ + += Raw data +#label("Anhang-A") + +#lorem(50) + +== More raw data + +#lorem(50) diff --git a/examples/digitaldog.jpg b/template/assets/digitaldog.jpg similarity index 100% rename from examples/digitaldog.jpg rename to template/assets/digitaldog.jpg diff --git a/template/glossary.typ b/template/glossary.typ new file mode 100644 index 0000000..2d4bd01 --- /dev/null +++ b/template/glossary.typ @@ -0,0 +1,15 @@ + +#let glossary = ( + ( + 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].] + ), + ( + key: "potato", + short: "potato", + plural: "potatoes", + desc: [#lorem(10)] + ), +) diff --git a/template/main.typ b/template/main.typ new file mode 100644 index 0000000..400d24c --- /dev/null +++ b/template/main.typ @@ -0,0 +1,112 @@ +#import "../src/lib.typ": dhbw-template + +#import "glossary.typ": glossary +#import "abstract.typ": abstract, summary + +#show: dhbw-template.with( + config: ( + lang: "en", + region: "en", + author: ( + name: "Sven Vogel", + semester: 4, + program: "Informationtechnology", + course: "TINF19IT1", + faculty: "Technik", + university: "DHBW Mannheim", + company: "ABB AG", + supervisor: "Benny Goodman", + matriculation-number: 123456789), + thesis: ( + title: "Unofficial ABB/DHBW Typst template", + subtitle: "for reports and thesises", + submission-date: "23rd march 2020", + timeframe: "1st january 2020 - 20th march 2020", + kind: "T2000", + summary: summary, + abstract: abstract, + keywords: ( "IT", "other stuff" ), + bibliography: bibliography("refs.bib"), + glossary: glossary, + appendices: include "appendix.typ"))) + +#import "@preview/wrap-it:0.1.0": wrap-content + += Lorem Ipsum + +#lorem(25) +@oidc + +#lorem(100) +@Anhang-A + +== Lorem Ipsum 2 + +#lorem(200) +@einstein + += Lorem Ipsum 3 + +#lorem(15) + +$ + angle.l a, b angle.r &= arrow(a) dot arrow(b) \ + &= a_1 b_1 + a_2 b_2 + ... a_n b_n \ + &= sum_(i=1)^n a_i b_i. +$ + +#lorem(140) + +#wrap-content( + figure(image("assets/digitaldog.jpg", width: 200pt), caption: [ Some image caption ]), + lorem(200)) + +#figure( + table( + columns: 2, + "Hello", "World"), + caption: [ Some table ]) + +#pagebreak() + +#figure( + ```rust +use std::env; +use std::fs::OpenOptions; +use std::io::Write; + +fn main() { + // Get the file path from the environment variable + let file_path = match env::var("OUTPUT_FILE") { + Ok(path) => path, + Err(_) => { + eprintln!("Error: OUTPUT_FILE environment variable is not set"); + return; + } + }; + + // Open the file in append mode, create it if it doesn't exist + let mut file = match OpenOptions::new() + .append(true) + .create(true) + .open(&file_path) + { + Ok(file) => file, + Err(e) => { + eprintln!("Error opening file {}: {}", file_path, e); + return; + } + }; + + // Write "Hello, World" to the file + if let Err(e) = writeln!(file, "Hello, World") { + eprintln!("Error writing to file: {}", e); + } else { + println!("Successfully appended 'Hello, World' to {}", file_path); + } +} + ```, caption: [Some code]) + += Conclusion + +#lorem(320) \ No newline at end of file diff --git a/template/refs.bib b/template/refs.bib new file mode 100644 index 0000000..226c7d7 --- /dev/null +++ b/template/refs.bib @@ -0,0 +1,12 @@ +@article{einstein, + author = "Albert Einstein", + title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) + [{On} the electrodynamics of moving bodies]", + journal = "Annalen der Physik", + volume = "322", + number = "10", + pages = "891--921", + year = "1905", + DOI = "http://dx.doi.org/10.1002/andp.19053221004", + keywords = "physics" +} \ No newline at end of file diff --git a/typst.toml b/typst.toml new file mode 100644 index 0000000..3330b1f --- /dev/null +++ b/typst.toml @@ -0,0 +1,16 @@ +[package] +name = "dhbw-abb-typst-template" +version = "0.1.0" +entrypoint = "src/template.typ" +authors = ["Sven Vogel "] +license = "MIT" +description = "Unoffical typst DHBW/ABB template for use as thesis and report works" +repository = "https://git.montehaselino.de/DHBW/dhbw-abb-typst-template" +keywords = ["dhbw", "abb", "thesis"] +categories = ["paper", "thesis", "report"] +exclude = ["examples"] + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "assets/thumbnail.png" \ No newline at end of file