add image and table listings
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
abstract,
|
abstract,
|
||||||
toc,
|
toc,
|
||||||
abbrlist,
|
abbrlist,
|
||||||
|
imagelist,
|
||||||
|
tablelist,
|
||||||
bibliogr
|
bibliogr
|
||||||
)
|
)
|
||||||
#import "../utils.typ": is_none, assert_dict_has, assert_not_none
|
#import "../utils.typ": is_none, assert_dict_has, assert_not_none
|
||||||
@@ -47,6 +49,8 @@
|
|||||||
abstract("en", title, abstract_content, keywords);
|
abstract("en", title, abstract_content, keywords);
|
||||||
toc(language);
|
toc(language);
|
||||||
abbrlist(language);
|
abbrlist(language);
|
||||||
|
imagelist(language);
|
||||||
|
tablelist(language);
|
||||||
content
|
content
|
||||||
bibliogr(language, citation_file);
|
bibliogr(language, citation_file);
|
||||||
});
|
});
|
||||||
|
@@ -32,6 +32,18 @@
|
|||||||
set text(font: serif_font);
|
set text(font: serif_font);
|
||||||
set par(justify: true);
|
set par(justify: true);
|
||||||
|
|
||||||
|
// figures
|
||||||
|
let figure_numbering(c) = {
|
||||||
|
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: table): set figure.caption(position: top);
|
||||||
|
show figure: it => {
|
||||||
|
block(it, above: 2em, below: 2em);
|
||||||
|
}
|
||||||
|
set image(width: 80%);
|
||||||
|
|
||||||
// heading
|
// heading
|
||||||
set heading(numbering: "1.1.1 ");
|
set heading(numbering: "1.1.1 ");
|
||||||
show heading: it => {
|
show heading: it => {
|
||||||
@@ -43,6 +55,10 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
show heading.where(level: 1): it => {
|
show heading.where(level: 1): it => {
|
||||||
|
// reset figure counters
|
||||||
|
context counter(figure.where(kind: image)).update(0);
|
||||||
|
context counter(figure.where(kind: table)).update(0);
|
||||||
|
|
||||||
pagebreak(weak: true);
|
pagebreak(weak: true);
|
||||||
v(2cm);
|
v(2cm);
|
||||||
it
|
it
|
||||||
@@ -54,7 +70,6 @@
|
|||||||
block(it, fill: rgb("#eee"), inset: 1em)
|
block(it, fill: rgb("#eee"), inset: 1em)
|
||||||
};
|
};
|
||||||
set highlight(fill: faculty_color.lighten(90%));
|
set highlight(fill: faculty_color.lighten(90%));
|
||||||
set image(width: 80%);
|
|
||||||
|
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
@@ -111,13 +126,13 @@
|
|||||||
}), info_name_min_width.to-absolute());
|
}), info_name_min_width.to-absolute());
|
||||||
grid(
|
grid(
|
||||||
columns: 2,
|
columns: 2,
|
||||||
rows: (auto, 1.2em),
|
gutter: .5em,
|
||||||
..info_fields.filter((v) => { type(v.at(1)) != type(none) }).map((v) => {
|
..info_fields.filter((v) => { type(v.at(1)) != type(none) }).map((v) => {
|
||||||
(
|
(
|
||||||
block(
|
align(top, block(
|
||||||
text(get_lang_item(language, v.at(0)) + ":", style: "italic", font: base_font),
|
text(get_lang_item(language, v.at(0)) + ":", style: "italic", font: base_font),
|
||||||
width: max_field_name_width + info_name_value_padding,
|
width: max_field_name_width + info_name_value_padding
|
||||||
),
|
)),
|
||||||
text(v.at(1), font: base_font, weight: if v.at(2) { "bold" } else { "regular" })
|
text(v.at(1), font: base_font, weight: if v.at(2) { "bold" } else { "regular" })
|
||||||
)
|
)
|
||||||
}).flatten(),
|
}).flatten(),
|
||||||
@@ -218,6 +233,59 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// _ OUTLINE
|
||||||
|
#let _outline_figure_inner(selector, title, body_mapper) = {
|
||||||
|
show outline.entry: it => {
|
||||||
|
link(
|
||||||
|
it.element.location(),
|
||||||
|
grid(
|
||||||
|
columns: 3,
|
||||||
|
gutter: .5em,
|
||||||
|
stack(
|
||||||
|
dir: ltr,
|
||||||
|
text(numbering(
|
||||||
|
"1. 1",
|
||||||
|
counter(heading).at(it.element.location()).at(0),
|
||||||
|
counter(selector).at(it.element.location()).at(0),
|
||||||
|
)),
|
||||||
|
h(.5em),
|
||||||
|
text(body_mapper(it)),
|
||||||
|
),
|
||||||
|
box(repeat([.], gap: 0.15em)),
|
||||||
|
str(it.element.location().page()),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if not is_none(selector) {
|
||||||
|
outline(target: selector, title: title);
|
||||||
|
} else {
|
||||||
|
outline(title: title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// _ FIGURE OUTLINE
|
||||||
|
|
||||||
|
#let _figure_outline(target, title) = {
|
||||||
|
context {
|
||||||
|
if counter(figure.where(kind: target)).final() == 0 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_outline_figure_inner(figure.where(kind: target), title, (it) => it.element.caption.body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IMAGE LIST
|
||||||
|
|
||||||
|
#let imagelist(language) = {
|
||||||
|
_figure_outline(image, get_lang_item(language, "image_list"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// TABLE LIST
|
||||||
|
|
||||||
|
#let tablelist(language) = {
|
||||||
|
_figure_outline(table, get_lang_item(language, "table_list"));
|
||||||
|
}
|
||||||
|
|
||||||
// ABBREVIATION LIST
|
// ABBREVIATION LIST
|
||||||
|
|
||||||
#let abbrlist(language) = {
|
#let abbrlist(language) = {
|
||||||
|
@@ -39,6 +39,8 @@
|
|||||||
"abstract": "Abstrakt",
|
"abstract": "Abstrakt",
|
||||||
"keywords": "Klíčová slova",
|
"keywords": "Klíčová slova",
|
||||||
"abbrs": "Seznam zkratek",
|
"abbrs": "Seznam zkratek",
|
||||||
|
"image_list": "Seznam obrázků",
|
||||||
|
"table_list": "Seznam tabulek",
|
||||||
|
|
||||||
"place_assignment": "Sem vložte zadání"
|
"place_assignment": "Sem vložte zadání"
|
||||||
},
|
},
|
||||||
@@ -72,6 +74,8 @@
|
|||||||
"abstract": "Abstract",
|
"abstract": "Abstract",
|
||||||
"keywords": "Keywords",
|
"keywords": "Keywords",
|
||||||
"abbrs": "List of abbreviations",
|
"abbrs": "List of abbreviations",
|
||||||
|
"image_list": "List of images",
|
||||||
|
"table_list": "List of tables",
|
||||||
|
|
||||||
"place_assignment": "Insert your assignment here"
|
"place_assignment": "Insert your assignment here"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user