Skip to content

Commit eb5a1c4

Browse files
committed
Add jaconf-eng package version 0.1.0
Signed-off-by: Shunsuke Kimura <[email protected]>
1 parent ab60c2d commit eb5a1c4

File tree

8 files changed

+724
-0
lines changed

8 files changed

+724
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
MIT No Attribution
2+
3+
Copyright 2024, 2025 Shunsuke Kimura
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
6+
software and associated documentation files (the "Software"), to deal in the Software
7+
without restriction, including without limitation the rights to use, copy, modify,
8+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9+
permit persons to whom the Software is furnished to do so.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
12+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
13+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
14+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
15+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
16+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Japananese Conference of Engineering
2+
3+
This is a template for **Japanese academic conference paper of engineerig**.
4+
5+
工学系の日本語の学会論文テンプレート。
6+
7+
## Usage
8+
9+
You can use this template in the Typst web app by clicking "Start from template"
10+
on the dashboard and searching for `jaconf-eng`.
11+
12+
Alternatively, you can use the CLI to kick this project off using the command
13+
14+
```
15+
typst init @preview/jaconf-eng
16+
```
17+
18+
Typst will create a new directory with all the files needed to get you started.
19+
20+
## Configuration
21+
22+
This template exports the `jaconf-eng` function with the following named arguments:
23+
24+
- `title-ja`: The paper's title in Japanese.
25+
- `title-en`: The paper's title in English.
26+
- `authors-ja`: The Authors' name and affiliations in Japanese.
27+
- `authors-ja`: The Authors' name and affiliations in English.
28+
- `abstract`: The content of a brief summary or `none`.
29+
- `keywords`: Array of index terms to display after the abstract.
30+
- `font-gothic`: The Gothic font used for headings.
31+
- `font-mincho`: The Mincho font used for the body.
32+
- `font-latin`: The Latin font used for description in English.
33+
34+
The function also accepts a single, positional argument for the body of the
35+
paper.
36+
37+
The template will initialize your package with a sample call to the `ieee`
38+
function in a show rule. If you want to change an existing project to use this
39+
template, you can add a show rule like this at the top of your file:
40+
41+
```typ
42+
#import "@preview/jaconf-eng:0.1.0": temp, definition, lemma, theorem, corollary, proof, appendix
43+
44+
#show: temp.with(
45+
title-ja: [日本語学会論文のテンプレート \ - サブタイトル - ],
46+
title-en: [How to Write a Conference Paper in Japanese],
47+
authors-ja: [◯ 著者姓1 著者名1、著者姓2 著者名2(○○○大学)、著者姓3 著者名3 (□□□株式会社)],
48+
authors-en: [\*A. First, B. Second (○○○ Univ.), and C. Third (□□□ Corp.)],
49+
abstract: [#lorem(80)],
50+
keywords: ([Typst], [conference paper writing], [manuscript format]),
51+
font-gothic: "Noto Sans CJK JP",
52+
font-mincho: "Noto Serif CJK JP",
53+
font-latin: "New Computer Modern"
54+
// The following settings may warn of missing font families. Please set a font that exists in your environment as an alternative.
55+
// 以下の設定では存在しないフォントファミリーが含まれていると警告が出ます。環境に存在するフォントを設定してください。
56+
// font-gothic: ("BIZ UDPGothic", "MS PGothic", "Hiragino Kaku Gothic Pro", "IPAexGothic", "Noto Sans CJK JP"),
57+
// font-mincho: ("BIZ UDPMincho", "MS PMincho", "Hiragino Mincho Pro", "IPAexMincho", "Noto Serif CJK JP"),
58+
// font-latin: ("Times New Roman", "New Computer Modern")
59+
)
60+
```
+182
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
#let font-size-default = 10pt
2+
#let font-size-heading = 11pt
3+
#let spacing-size-heading = 12pt
4+
#let appendix-numbering = "A.1"
5+
#let state-font-gothic = state("gothic", (:))
6+
7+
// import third-party packages
8+
#import "@preview/codly:1.1.1": codly-init
9+
#import "@preview/ctheorems:1.1.3": thmplain, thmproof, thmrules
10+
11+
// Theorem environments
12+
#let thmja = thmplain.with(base: {}, separator: [#h(0.5em)], titlefmt: strong, inset: (top: 0em, left: 0em))
13+
#let definition = thmja("definition", context{text(font: state-font-gothic.get())[定義]})
14+
#let lemma = thmja("lemma", context{text(font: state-font-gothic.get())[補題]})
15+
#let theorem = thmja("theorem", context{text(font: state-font-gothic.get())[定理]})
16+
#let corollary = thmja("corollary", context{text(font: state-font-gothic.get())[系]})
17+
#let proof = thmproof("proof", context{text(font: state-font-gothic.get())[証明]}, separator: [#h(0.9em)], titlefmt: strong, inset: (top: 0em, left: 0em))
18+
19+
#let jaconf(
20+
title-ja: [日本語タイトル],
21+
title-en: [],
22+
authors-ja: [著者],
23+
authors-en: [],
24+
abstract: none,
25+
keywords: (),
26+
font-gothic: "Noto Sans CJK JP",
27+
font-mincho: "Noto Serif CJK JP",
28+
font-latin: "New Computer Modern",
29+
body
30+
) = {
31+
// Set the font for headings.
32+
state-font-gothic.update(font-gothic)
33+
34+
// Enable packages.
35+
show: thmrules.with(qed-symbol: $square$)
36+
show: codly-init.with()
37+
38+
// Set document metadata.
39+
set document(title: title-ja)
40+
41+
// Configure the page.
42+
set page(
43+
paper: "a4",
44+
margin: (top: 20mm, bottom: 27mm, x: 20mm)
45+
)
46+
set text(font-size-default, font: font-mincho)
47+
set par(leading: 0.5em, first-line-indent: 1em, justify: true, spacing: 0.6em)
48+
show "": ""
49+
show "": ""
50+
51+
// Configure equation numbering and spacing.
52+
set math.equation(numbering: "(1)")
53+
show math.equation: set block(spacing: 0.55em)
54+
55+
// Configure appearance of references
56+
show ref: it => {
57+
// Equation -> (n).
58+
// See https://typst.app/docs/reference/model/ref/
59+
let eq = math.equation
60+
let el = it.element
61+
if el != none and el.func() == eq {
62+
link(el.location(), numbering(
63+
el.numbering,
64+
..counter(eq).at(el.location())
65+
))
66+
}
67+
// Sections -> n章m節l項.
68+
// Appendix -> 付録A.
69+
else if el != none and el.func() == heading {
70+
let sec-cnt = counter(heading).at(el.location())
71+
if el.numbering != appendix-numbering{
72+
if el.depth == 1 {
73+
link(el.location(), [#sec-cnt.at(0)章])
74+
} else if el.depth == 2{
75+
link(el.location(), [#sec-cnt.at(0)章#sec-cnt.at(1)節])
76+
} else if el.depth == 3{
77+
link(el.location(), [#sec-cnt.at(0)章#sec-cnt.at(1)節#sec-cnt.at(2)項])
78+
}
79+
} else {
80+
link(el.location(), [
81+
付録#numbering(el.numbering, ..sec-cnt)
82+
])
83+
}
84+
} else {
85+
it
86+
}
87+
}
88+
89+
// Configure lists.
90+
set enum(indent: 1em)
91+
set list(indent: 1em)
92+
93+
// Configure headings.
94+
set heading(numbering: "1.1")
95+
show heading: it => {
96+
set par(first-line-indent: 0em, spacing: spacing-size-heading)
97+
let levels = counter(heading).get()
98+
if it.level == 1 {
99+
set text(font-size-heading, font: font-gothic)
100+
// Acknowledgment sections are not numbered.
101+
if it.numbering != none and not it.body in ([謝辞], [Acknowledgment], [Acknowledgement]) {
102+
numbering(it.numbering, ..levels)
103+
h(1em)
104+
}
105+
it.body
106+
} else {
107+
set text(font-size-default, font: font-gothic)
108+
if it.numbering != none {
109+
numbering(it.numbering, ..levels)
110+
h(1em)
111+
}
112+
it.body
113+
}
114+
}
115+
116+
// Configure figures.
117+
show figure.where(kind: table): set figure(placement: top, supplement: [Table])
118+
show figure.where(kind: table): set figure.caption(position: top, separator: [: ])
119+
show figure.where(kind: image): set figure(placement: top, supplement: [Fig.])
120+
show figure.where(kind: image): set figure.caption(position: bottom, separator: [: ])
121+
122+
// Display the paper's title.
123+
align(center, text(16pt, title-ja, weight: "bold", font: font-gothic))
124+
v(18pt, weak: true)
125+
126+
// Display the authors list.
127+
align(center, text(12pt, authors-ja, font: font-mincho))
128+
v(1.5em, weak: true)
129+
130+
// Display the paper's title in English.
131+
align(center, text(12pt, title-en, weight: "bold", font: font-latin))
132+
v(1.5em, weak: true)
133+
134+
// Display the authors list in English.
135+
align(center, text(12pt, authors-en, font: font-latin))
136+
v(1.5em, weak: true)
137+
138+
// Display abstract and index terms.
139+
if abstract != none {
140+
grid(
141+
columns: (0.7cm, 1fr, 0.7cm),
142+
[],
143+
[
144+
#set text(10pt, font: font-latin)
145+
#set par(first-line-indent: 0em)
146+
*Abstract--* #h(0.5em) #abstract
147+
#v(1em)
148+
*Key Words:* #h(0.5em) #keywords.join(", ")
149+
],
150+
[]
151+
)
152+
v(1em, weak: false)
153+
}
154+
155+
// Start two column mode and configure paragraph properties.
156+
show: columns.with(2)
157+
158+
// Configure Bibliography.
159+
set bibliography(title: text(font-size-heading)[参考文献], style: "sice.csl")
160+
show bibliography: it => [
161+
#set text(9pt, font: font-mincho)
162+
#show regex("[0-9a-zA-Z]"): set text(font: font-latin)
163+
#it
164+
]
165+
166+
// Display the paper's contents.
167+
body
168+
}
169+
170+
// Appendix
171+
#let appendix(body) = {
172+
set heading(numbering: appendix-numbering)
173+
counter(heading).update(0)
174+
counter(figure.where(kind: image)).update(0)
175+
counter(figure.where(kind: table)).update(0)
176+
set figure(numbering: it => {
177+
[#numbering("A", counter(heading).get().at(0)).#it]
178+
})
179+
v(spacing-size-heading)
180+
context(text(font-size-heading, font: state-font-gothic.get(), weight: "bold")[付録])
181+
body
182+
}

0 commit comments

Comments
 (0)