Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
vonbrank committed Apr 30, 2024
2 parents a0c9b7d + bbf82b6 commit 9bdb2dd
Show file tree
Hide file tree
Showing 16 changed files with 158 additions and 158 deletions.
2 changes: 1 addition & 1 deletion common/components/figure.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#let algorithm_figure(content, caption: [], supplement: [算法], label-name: "") = {
#let algorithm-figure(content, caption: [], supplement: [算法], label-name: "") = {
let fig = figure(
[#line(length: 100%, stroke: 0.05mm)
#v(0.5em, weak: true)
Expand Down
20 changes: 10 additions & 10 deletions common/components/table.typ
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
)
*/

#let three_line_table(..args) = {
#let three-line-table(..args) = {
let values = args.pos()
let header_values = if values.len() > 0 {
let header-values = if values.len() > 0 {
values.at(0)
} else {
()
}
let content_values = if values.len() > 1 {
let content-values = if values.len() > 1 {
values.slice(1)
} else {
()
}

let table_cell(content: none) = {
let table-cell(content: none) = {
set align(center)
rect(
width: 100%,
Expand All @@ -37,21 +37,21 @@
v(0em, weak: true)
pad(y: 0.25em)[
#grid(
columns: header_values.len(),
..header_values.map(content => table_cell(content: content)).flatten(),
columns: header-values.len(),
..header-values.map(content => table-cell(content: content)).flatten(),
)
]
v(0em, weak: true)
line(length: 100%, stroke: 0.05mm)

if content_values.len() > 0 {
if content-values.len() > 0 {
v(0em, weak: true)
pad(y: 0.25em)[
#grid(
columns: header_values.len(),
columns: header-values.len(),
row-gutter: 0.25em,
..content_values.map(line_content => {
(..line_content.map(content => table_cell(content: content)).flatten(),)
..content-values.map(line-content => {
(..line-content.map(content => table-cell(content: content)).flatten(),)
}).flatten(),
)
]
Expand Down
4 changes: 2 additions & 2 deletions harbin/bachelor/components/typography.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#let special_chapter_format_heading(it: none, font: none, size: none, weight: "regular") = {
#let special-chapter-format-heading(it: none, font: none, size: none, weight: "regular") = {
set text(font: font, size: size)

text(weight: weight)[
Expand All @@ -11,7 +11,7 @@
v(0.5em)
}

#let main_format_heading(it: none, font: none, size: none, weight: "regular") = {
#let main-format-heading(it: none, font: none, size: none, weight: "regular") = {
set text(font: font, size: size)

text(weight: weight)[
Expand Down
21 changes: 11 additions & 10 deletions harbin/bachelor/conf.typ
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "../../common/theme/type.typ": 字体, 字号
#import "components/typography.typ": main_format_heading, special_chapter_format_heading
#import "utils/numbering.typ": heading_numbering
#import "config/constants.typ": special_chapter_titles
#import "components/typography.typ": main-format-heading, special-chapter-format-heading
#import "utils/numbering.typ": heading-numbering
#import "config/constants.typ": special-chapter-titles
#import "@preview/cuti:0.2.1": show-cn-fakebold
#import "@preview/i-figured:0.2.4": show-figure, reset-counters, show-equation

Expand Down Expand Up @@ -47,7 +47,7 @@

if it.level == 1 {
align(center)[
#special_chapter_format_heading(it: it, font: 字体.黑体, size: 字号.小二)
#special-chapter-format-heading(it: it, font: 字体.黑体, size: 字号.小二)
]
} else {
it
Expand Down Expand Up @@ -77,25 +77,26 @@

counter(page).update(1)

set heading(numbering: heading_numbering)
set heading(numbering: heading-numbering)

show heading: it => {
set par(first-line-indent: 0em)

if it.level == 1 {
align(center)[
#main_format_heading(it: it, font: 字体.黑体, size: 字号.小二)
#main-format-heading(it: it, font: 字体.黑体, size: 字号.小二)
]
} else if it.level == 2 {
main_format_heading(it: it, font: 字体.黑体, size: 字号.小三)
main-format-heading(it: it, font: 字体.黑体, size: 字号.小三)
} else if it.level >= 3 {
main_format_heading(it: it, font: 字体.黑体, size: 字号.小四)
main-format-heading(it: it, font: 字体.黑体, size: 字号.小四)
}
}

show heading: reset-counters.with(extra-kinds: ("algorithm",) + extra-kinds)
show figure: show-figure.with(numbering: "1-1", extra-prefixes: ("algorithm": "algo:") + extra-prefixes)
show figure.where(kind: table): set figure.caption(position: top)
show figure.where(kind: raw): set figure.caption(position: top)
show figure.where(kind: "algorithm"): set figure.caption(position: top)

show raw.where(block: false): box.with(
Expand All @@ -120,7 +121,7 @@
size: 10.5pt,
)

show math.equation: show-equation
show math.equation: show-equation.with(numbering: "(1-1)")

show ref: it => {
let eq = math.equation
Expand All @@ -146,7 +147,7 @@

if it.level == 1 {
align(center)[
#special_chapter_format_heading(it: it, font: 字体.黑体, size: 字号.小二)
#special-chapter-format-heading(it: it, font: 字体.黑体, size: 字号.小二)
]
} else {
it
Expand Down
4 changes: 2 additions & 2 deletions harbin/bachelor/config/constants.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#let special_chapter_titles = (
#let special-chapter-titles = (
摘要: "摘 要",
Abstract: "Abstract",
目录: "目 录",
Expand All @@ -9,4 +9,4 @@
成果: "攻读学士学位期间取得创新性成果",
)

#let current_date = datetime.today()
#let current-date = datetime.today()
10 changes: 5 additions & 5 deletions harbin/bachelor/lib.typ
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#import "conf.typ": doc, preface, main, ending
#import "pages/cover.typ": cover
#import "pages/abstract.typ": abstract_cn, abstract_en
#import "pages/outline.typ": outline_page
#import "pages/bibliography.typ": bibliography_page
#import "pages/abstract.typ": abstract-cn, abstract-en
#import "pages/outline.typ": outline-page
#import "pages/bibliography.typ": bibliography-page
#import "pages/acknowledgement.typ": acknowledgement
#import "pages/achievement.typ": achievement
#import "config/constants.typ": special_chapter_titles
#import "pages/declaration-of-originality.typ": declaration_of_originality
#import "config/constants.typ": special-chapter-titles
#import "pages/declaration-of-originality.typ": declaration-of-originality
#import "../../common/components/typography.typ": indent
18 changes: 9 additions & 9 deletions harbin/bachelor/pages/abstract.typ
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "../../../common/theme/type.typ": 字体, 字号
#import "../config/constants.typ": special_chapter_titles
#import "../config/constants.typ": special-chapter-titles

#let abstract_cn(
#let abstract-cn(
content,
keywords: (),
) = {
Expand All @@ -11,23 +11,23 @@
leading: 1em,
)

heading(special_chapter_titles.摘要, level: 1)
heading(special-chapter-titles.摘要, level: 1)

text(
font: 字体.宋体,
size: 字号.小四,
)[#content]

let abstract_key_words(content) = {
let abstract-key-words(content) = {
set par(first-line-indent: 0em)
text(font: 字体.黑体)[关键词:]
text(font: 字体.宋体)[#content.join(",")]
}

abstract_key_words(keywords)
abstract-key-words(keywords)
}

#let abstract_en(
#let abstract-en(
content,
keywords: (),
) = {
Expand All @@ -37,19 +37,19 @@
leading: 1em,
)

heading(special_chapter_titles.Abstract, level: 1)
heading(special-chapter-titles.Abstract, level: 1)

text(
font: 字体.宋体,
size: 字号.小四,
)[#content]

let abstract_key_words(content) = {
let abstract-key-words(content) = {
set par(first-line-indent: 0em)

text(font: 字体.宋体, weight: "bold", "Keywords: ")
text(font: 字体.宋体)[#content.join(",")]
}

abstract_key_words(keywords)
abstract-key-words(keywords)
}
4 changes: 2 additions & 2 deletions harbin/bachelor/pages/achievement.typ
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#import "../config/constants.typ": special_chapter_titles
#import "../config/constants.typ": special-chapter-titles

#let achievement(
content,
) = [

#heading(special_chapter_titles.成果, level: 1, numbering: none)
#heading(special-chapter-titles.成果, level: 1, numbering: none)

#content
]
4 changes: 2 additions & 2 deletions harbin/bachelor/pages/acknowledgement.typ
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#import "../config/constants.typ": special_chapter_titles
#import "../config/constants.typ": special-chapter-titles

#let acknowledgement(
content,
) = [

#heading(special_chapter_titles.致谢, level: 1, numbering: none)
#heading(special-chapter-titles.致谢, level: 1, numbering: none)

#content
]
6 changes: 3 additions & 3 deletions harbin/bachelor/pages/bibliography.typ
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#import "../config/constants.typ": special_chapter_titles
#import "../config/constants.typ": special-chapter-titles

#let bibliography_page(
#let bibliography-page(
bibliography,
) = [

#heading(special_chapter_titles.参考文献, level: 1, numbering: none)
#heading(special-chapter-titles.参考文献, level: 1, numbering: none)

#bibliography(title: none)
]
Loading

0 comments on commit 9bdb2dd

Please sign in to comment.