diff --git a/src/lib.typ b/src/lib.typ index 2580860..37266ea 100644 --- a/src/lib.typ +++ b/src/lib.typ @@ -6,6 +6,7 @@ #import "./utils.typ" #let dstu-table = style.dstu-table +#let hfill = utils.hfill /// Coursework template for NURE /// - university (str): University code, default "ХНУРЕ" @@ -31,7 +32,8 @@ bib-path: none, appendices: (), ) = { - set document(title: title, author: authors.map(c => c.name)) + let doc-title = if type(title) == array { title.join(" ") } else { title } + set document(title: doc-title, author: authors.map(c => c.name)) show: style.dstu.with(skip: 1) @@ -66,6 +68,7 @@ /// - task-list (dict): Task metadata /// - calendar-plan (dict): Calendar plan table /// - abstract (dict): Keywords and abstract text +/// - abstract-en (dict): Optional English keywords and abstract text /// - bib-path (str): Path to bibliography file /// - appendices (content): Appendix content #let coursework-v2( @@ -77,6 +80,7 @@ task-list: (), calendar-plan: (), abstract: (), + abstract-en: none, bib-path: none, appendices: (), faculty: "комп’ютерних наук", @@ -87,7 +91,8 @@ assert(authors.len() > 0, message: "At least one author required") assert(mentors.len() > 0, message: "At least one mentor required") - set document(title: title, author: authors.map(c => c.name)) + let doc-title = if type(title) == array { title.join(" ") } else { title } + set document(title: doc-title, author: authors.map(c => c.name)) show: style.dstu.with(skip: 1) @@ -97,6 +102,12 @@ bib-count.update(((..c)) => (..c, it.key)) } + let abstract = if abstract-en != none { + abstract + (en: abstract-en) + } else { + abstract + } + tp.cw-v2.nure( university, title, diff --git a/src/title-pages/coursework-v2/nure.typ b/src/title-pages/coursework-v2/nure.typ index 9591e23..af99f70 100644 --- a/src/title-pages/coursework-v2/nure.typ +++ b/src/title-pages/coursework-v2/nure.typ @@ -1,7 +1,7 @@ #import "../../shared.typ": universities #import "../../helpers.typ": * #import "../../style.typ": spacing -#import "../../utils.typ": bold, uline +#import "../../utils.typ": bold, uline, filled-lines #let note(content) = block(width: 100%, above: 5pt, below: 0pt)[ #set text(size: 10pt) @@ -69,7 +69,7 @@ #let task-num(n) = box(str(n) + ".") #let title-field(value) = { - uline(align: center, value) + uline(align: center, filled-lines(value)) uline(align: center, []) note[(тема)] } @@ -126,7 +126,7 @@ #set align(left) #inline-label-line( [Факультет], - faculty + " (або центр післядипломної освіти, або навчально-науковий центр заочної форми навчання)", + faculty, ) #note([(повна назва)]) @@ -201,8 +201,7 @@ ( [Факультет], ( - faculty + " (або центр післядипломної освіти, або", - "навчально-науковий центр заочної форми навчання)", + faculty, ), ), ([Кафедра], edu-prog.department-gen), @@ -234,20 +233,20 @@ #v(1.0em) - #task-num(1) Тема роботи #uline(align: left)[#title] + #task-num(1) Тема роботи #uline(align: left, filled-lines(title)) #v(0.4em) #task-num(2) Термін здачі студентом закінченої роботи “#underline(task-list.done-date.display("[day]"))” #underline(month-gen(task-list.done-date.month())) #task-list.done-date.display("[year]")р. #v(0.4em) - #task-num(3) Вихідні дані до проєкту #uline(align: left, task-list.at("source", default: [])) + #task-num(3) Вихідні дані до проєкту #uline(align: left, filled-lines(task-list.at("source", default: []))) #v(0.4em) #uline(align: left, []) #v(0.4em) #task-num(4) Перелік питань, що потрібно опрацювати в роботі\ - #uline(align: left, task-list.at("content", default: [])) + #uline(align: left, filled-lines(task-list.at("content", default: []))) #v(0.4em) #uline(align: left, []) diff --git a/src/utils.typ b/src/utils.typ index 1b81922..6345db9 100644 --- a/src/utils.typ +++ b/src/utils.typ @@ -7,6 +7,13 @@ /// fill horizontal space with a filled box #let hfill(width) = box(width: width, repeat(" ")) // HAIR SPACE (U+200A) +/// convert an array of lines into filled lines for underlined task fields +#let filled-lines(content) = if type(content) == array { + content.map(line => [#line #hfill(1fr)]).join(linebreak()) +} else { + content +} + /// underlined cell with centered content by default #let uline(align: center, content) = underline[ #if align != left { hfill(1fr) } diff --git a/template/default/coursework-v2.typ b/template/default/coursework-v2.typ index 61cf4ae..e003039 100644 --- a/template/default/coursework-v2.typ +++ b/template/default/coursework-v2.typ @@ -23,8 +23,16 @@ #let task-list = ( done-date: datetime(year: 2026, month: 12, day: 27), initial-date: datetime(year: 2026, month: 9, day: 15), - source: [], - content: [], + source: [ + Узагальнити модель предметної області, + визначити основні сутності та зв'язки між ними. + Підготувати демонстраційний набір технологій для шаблону. + ], + content: [ + Опис предметної галузі, формування вимог, + архітектурне проєктування, тестування та + перевірка верстки пояснювальної записки. + ], ) #let calendar-plan = ( @@ -67,6 +75,31 @@ ], ) +#let abstract_en = ( + keywords: ( + "WEB APPLICATION", + "INFORMATION SYSTEM", + "COURSEWORK", + "SOFTWARE ENGINEERING", + "DEMO SAMPLE", + ), + text: [ + The purpose of this work is to demonstrate the formatting of a coursework + explanatory note using the new template variant. + + The sample contains a generalized topic, typical pages for the assignment, + calendar plan, abstract, contents, bibliography, and appendices. + + The work presents an illustrative structure of a software system that can be + adapted to a specific subject area. The main focus is on checking title-page + fields, assignment-page fields, signature blocks, section numbering, and + appendix handling. + + The result is a demonstration document that shows the expected template usage + without being tied to a real student, supervisor, or completed project. + ], +) + #let appendices = [ = Приклад звіту 1 #v(-spacing) @@ -83,12 +116,16 @@ ] #show: coursework-v2.with( - title: "Демонстраційна інформаційна система для комплексного курсового проєкту", + title: ( + "Демонстраційна інформаційна система для комплексного ", + "курсового проєкту", + ), authors: authors, mentors: mentors, task-list: task-list, calendar-plan: calendar-plan, abstract: abstract, + abstract-en: abstract_en, bib-path: bytes(read("bibl.yml")), appendices: appendices, )