Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: title が1文の場合の対処 #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
38 changes: 24 additions & 14 deletions template/head.typ
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,34 @@
title: (),
names: (),
affiliations: (),
footnotes: (:)
footnotes: (:),
) = {
set align(center)

set text(
16pt,
weight: 900,
)
mixed(
fonts.sans-ja,
fonts.serif-ja,
grid(
rows: title.len(),
row-gutter: 8pt,
..title.map(title => {
text(
16pt,
weight: 500,
[#title \ ],
)
}),
),
if type(title) == "array" {
grid(
rows: title.len(),
row-gutter: 8pt,
..title,
)
} else {
grid(
rows: 1,
row-gutter: 8pt,
title,
)
},
)
set text(
8.8pt,
weight: 400,
)

spacer()
Expand All @@ -41,7 +51,7 @@
gutter: 1em,
columns: calc.min(names.len(), 5),
..names.map(author => {
let footnote = footnotes.at(str(author.group));
let footnote = footnotes.at(str(author.group))

[#author.ja#super(numbering("*", footnote.index))]
}),
Expand All @@ -50,7 +60,7 @@
gutter: 1em,
columns: calc.min(affiliations.len(), 5),
..affiliations.map(author => {
let footnote = footnotes.at(str(author.group));
let footnote = footnotes.at(str(author.group))

[#author.ja#super(numbering("*", footnote.index))]
}),
Expand Down
55 changes: 33 additions & 22 deletions template/template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@
body,
) = {
// ドキュメントの設定
set document(
title: title.join(""),
author: names.map(a => a.ja)
)
if type(title) == "array" {
set document(
title: title.join(""),
author: names.map(a => a.ja),
)
} else {
set document(
title: title,
author: names.map(a => a.ja),
)
}

// ページの設定
set par(
Expand All @@ -28,7 +35,7 @@
set page(
columns: 2,
paper: paper-size,
footer: align(center)[#context(counter(page).display("1"))]
footer: align(center)[#context (counter(page).display("1"))],
)

set figure(
Expand All @@ -41,9 +48,7 @@
}

// 段落の設定
set heading(
numbering: "1.1.1",
)
set heading(numbering: "1.1.1")

// 図の設定
set figure(supplement: "図")
Expand All @@ -59,27 +64,33 @@
text(
font: fonts.sans-ja,
weight: "medium",
it
it,
)
spacer()
}

let footnotes = (:);
let footnotes = (:)
for author in names + affiliations {
let is_exist = footnotes.keys().contains(str(author.group));
let is_exist = footnotes.keys().contains(str(author.group))
let index = 0

if not is_exist {
footnotes.insert(str(author.group), (
index: footnotes.len() + 1,
text: author.en,
));
footnotes.insert(
str(author.group),
(
index: footnotes.len() + 1,
text: author.en,
),
)
} else {
let text = footnotes.at(str(author.group)).text;
footnotes.insert(str(author.group), (
index: footnotes.at(str(author.group)).index,
text: text + ", " + author.en,
));
let text = footnotes.at(str(author.group)).text
footnotes.insert(
str(author.group),
(
index: footnotes.at(str(author.group)).index,
text: text + ", " + author.en,
),
)
}
}

Expand All @@ -93,11 +104,11 @@
names: names,
affiliations: affiliations,
footnotes: footnotes,
)
),
)

set footnote(numbering: "*")
show footnote: it => text(size:0pt, it)
show footnote: it => text(size: 0pt, it)
for f in footnotes {
footnote(str(f.at(1).text))
}
Expand Down