diff --git a/src/config.typ b/src/config.typ index d8388b6..21da203 100644 --- a/src/config.typ +++ b/src/config.typ @@ -1,3 +1,11 @@ +/// Whether to number figures per section or not. +/// If true, figures will be numbered like "1.1", "1.2", "2.1", etc. +/// If false, figures will be numbered like "1", "2", "3", etc. +/// +/// TODO: figure out how to deal with numbering on sections such as +/// Appendix and other non-standard sections. +#let __FIG_PER_SECTION = state("svetikas.lt/ktu-paper/figure-numbering-per-section", false) + #let __DEBUG_AUTHOR_TABLE = state("$ktu-template-DEBUG_AUTHOR_TABLE", false) #let debug-author-table() = { __DEBUG_AUTHOR_TABLE.update(true) diff --git a/src/lib.typ b/src/lib.typ index f5ef48f..f9342df 100644 --- a/src/lib.typ +++ b/src/lib.typ @@ -1,5 +1,5 @@ #import "@preview/codly:1.3.0": codly, codly-init -#import "config.typ": debug-author-table, enable-heading-experiment, __HEADING_EXPERIMENT +#import "config.typ": debug-author-table, enable-heading-experiment, __HEADING_EXPERIMENT, __FIG_PER_SECTION #import "fragments.typ": ( ktu-table, ktu-heading-page-centered, ktu-heading-page-normal, ktu-academic-honestly-declaration-page @@ -391,7 +391,10 @@ body } -#let setup-page(font: "Times New Roman", body) = { +#let setup-page( + font: "Times New Roman", + body +) = { show: __page_rules.with(font: font) // Pagal formaliuosius rašto darbų reikalavimus @@ -537,3 +540,15 @@ body } +/// Configure the template for a KTU paper. +/// - font (str): Font to use for the paper. +/// - figureNumberingPerSection (bool): Whether to number figures per section rather than globally. +#let ktu-paper( + font: "Times New Roman", + figureNumberingPerSection: false, + body +) = context { + show: setup-page.with(font: font) + __FIG_PER_SECTION.update(true) + body +}