Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions template/article.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#import "/template/init.typ": initialize
#import "/template/codeblock.typ": init-codeblock

#let author-label(name, authormark) = {
if authormark == none {
name
} else {
[#authormark#name]
}
}

#let author-block(name, authormark) = [
#metadata(name) <author>
#align(
Expand All @@ -9,12 +17,20 @@
top: 1.0em,
bottom: 1.75em,
text(size: 10.5pt)[
#authormark#name
#author-label(name, authormark)
],
),
)
]

#let reset-article-counters() = {
counter(footnote).update(0)
counter(math.equation).update(0)
counter(figure.where(kind: image)).update(0)
counter(figure.where(kind: table)).update(0)
counter(figure.where(kind: raw)).update(0)
}

#let article(
title: "",
author: "",
Expand All @@ -30,11 +46,7 @@

set heading(offset: 1)

counter(footnote).update(0)
counter(math.equation).update(0)
counter(figure.where(kind: image)).update(0)
counter(figure.where(kind: table)).update(0)
counter(figure.where(kind: raw)).update(0)
reset-article-counters()

body
}
4 changes: 2 additions & 2 deletions template/backcover.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#let date-format = "[year]年[month repr:numerical padding:none]月[day padding:none]日";
#import "/template/constants.typ": assets, date-format

#let backcover(
title: "",
Expand All @@ -21,7 +21,7 @@
dy: -4pt,
image(
width: 100%,
"assets/wordlogo.svg",
assets.wordlogo,
),
)

Expand Down
17 changes: 17 additions & 0 deletions template/constants.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#let fonts = (
header: ("TeX Gyre Termes", "Noto Serif CJK JP"),
heading: ("TeX Gyre Termes", "Noto Sans CJK JP"),
body: ("TeX Gyre Termes", "Noto Serif CJK JP"),
raw: ("Source Code Pro", "Noto Sans CJK JP"),
page-number: "EB Garamond",
)

#let assets = (
cover: "assets/cover.png",
rawtheme: "assets/quiet.tmTheme",
wordlogo: "assets/wordlogo.svg",
)

#let date-format = "[year]年[month repr:numerical padding:none]月[day padding:none]日"

#let jp-pattern = "[\p{scx:Han}\p{scx:Hira}\p{scx:Kana}]"
4 changes: 3 additions & 1 deletion template/cover.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#import "/template/constants.typ": assets

#let cover() = {
set page(
header: none,
footer: none,
background: image("assets/cover.png"),
background: image(assets.cover),
)

pagebreak()
Expand Down
2 changes: 0 additions & 2 deletions template/project.typ
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#import "/template/cover.typ": cover
#import "/template/backcover.typ": backcover

#let date-format = "[year]年[month repr:numerical padding:none]月[day padding:none]日"

#let project(
title: "",
author: "筑波大学情報学群 情報科学類 WORD編集部",
Expand Down
16 changes: 4 additions & 12 deletions template/utils.typ
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
#let fonts = (
header: ("TeX Gyre Termes", "Noto Serif CJK JP"),
heading: ("TeX Gyre Termes", "Noto Sans CJK JP"),
body: ("TeX Gyre Termes", "Noto Serif CJK JP"),
raw: ("Source Code Pro", "Noto Sans CJK JP"),
page-number: "EB Garamond",
)
#import "/template/constants.typ": assets, fonts, jp-pattern

#let jp-pattern = "[\p{scx:Han}\p{scx:Hira}\p{scx:Kana}]"

#let pageno = (page-numbering, display-page, actucal-page) => {
#let pageno = (page-numbering, display-page, actual-page) => {
if (page-numbering == none) {
none
} else {
let isOdd = calc.odd(actucal-page)
let isOdd = calc.odd(actual-page)
place(
if isOdd { right } else { left },
dx: 13mm * if (isOdd) { 1 } else { -1 },
Expand Down Expand Up @@ -150,7 +142,7 @@
show raw: set text(font: fonts.raw)
set raw(
// コメントだけ色が薄いカラースキーム
theme: "assets/quiet.tmTheme",
theme: assets.rawtheme,
)

show quote: set pad(0em)
Expand Down