classic template fixes

This commit is contained in:
2025-10-02 20:57:22 +02:00
parent eba0ec7826
commit d954a0e687
3 changed files with 26 additions and 13 deletions

View File

@@ -7,6 +7,11 @@
#let serif_font = "Merriweather";
#let tul_logomark_size = 6.5em;
// COUNTERS
#let image_count = counter("image_count");
#let table_count = counter("table_count");
// TYPST ELEMENT STYLING
#let default_styling(flip_bonding, faculty_color, content) = {
@@ -33,11 +38,12 @@
set par(justify: true);
// figures
let figure_numbering(c) = {
let figure_numbering(realcount, c) = {
context realcount.step();
context numbering("1. 1", counter(heading).get().at(0), c)
};
show figure.where(kind: image): set figure(numbering: figure_numbering);
show figure.where(kind: table): set figure(numbering: figure_numbering);
show figure.where(kind: image): set figure(numbering: figure_numbering.with(image_count));
show figure.where(kind: table): set figure(numbering: figure_numbering.with(table_count));
show figure.where(kind: table): set figure.caption(position: top);
show figure: it => {
block(it, above: 2em, below: 2em);
@@ -265,9 +271,9 @@
// _ FIGURE OUTLINE
#let _figure_outline(target, title) = {
#let _figure_outline(realcount, target, title) = {
context {
if counter(figure.where(kind: target)).final() == 0 {
if realcount.final().at(0) == 0 {
return;
}
_outline_figure_inner(figure.where(kind: target), title, (it) => it.element.caption.body);
@@ -277,13 +283,13 @@
// IMAGE LIST
#let imagelist(language) = {
_figure_outline(image, get_lang_item(language, "image_list"));
_figure_outline(image_count, image, get_lang_item(language, "image_list"));
}
// TABLE LIST
#let tablelist(language) = {
_figure_outline(table, get_lang_item(language, "table_list"));
_figure_outline(table_count, table, get_lang_item(language, "table_list"));
}
// ABBREVIATION LIST

View File

@@ -1,5 +1,15 @@
#import "../lang.typ": get_lang_item
#import "common.typ": mainpage, default_styling, assignment, disclaimer, abstract, toc, abbrlist
#import "common.typ": (
mainpage,
default_styling,
assignment,
disclaimer,
abstract,
toc,
abbrlist,
imagelist,
tablelist,
)
#import "../utils.typ": is_none, assert_not_none, assert_dict_has, assert_in_arr
#let other(
@@ -18,7 +28,8 @@
default_styling(true, faculty_color, {
toc(language);
abbrlist(language);
imagelist(language);
tablelist(language);
pagebreak(to: "even", weak: true);
content